]>
diplodocus.org Git - nmh/blob - sbr/unquote.c
1 /* unquote.c -- Handle quote removal and quoted-pair strings on
4 * This code is Copyright (c) 2013, by the authors of nmh. See the
5 * COPYRIGHT file in the root directory of the nmh distribution for
6 * complete copyright information.
12 * Remove quotes (and handle escape strings) from RFC 5322 quoted-strings.
14 * Since we never add characters to the string, the output buffer is assumed
15 * to have at least as many characters as the input string.
20 unquote_string(const char *input
, char *output
)
22 int n
= 0; /* n is the position in the input buffer */
23 int m
= 0; /* m is the position in the output buffer */
25 while ( input
[n
] != '\0') {
29 if ( input
[n
] != '\0')
30 output
[m
++] = input
[n
++];
36 output
[m
++] = input
[n
++];