2 * unquote.c: Handle quote removal and quoted-pair strings on
5 * This code is Copyright (c) 2013, by the authors of nmh. See the
6 * COPYRIGHT file in the root directory of the nmh distribution for
7 * complete copyright information.
13 * Remove quotes (and handle escape strings) from RFC 5322 quoted-strings.
15 * Since we never add characters to the string, the output buffer is assumed
16 * to have at least as many characters as the input string.
21 unquote_string(const char *input, char *output)
23 int n = 0; /* n is the position in the input buffer */
24 int m = 0; /* m is the position in the output buffer */
26 while ( input[n] != '\0') {
30 if ( input[n] != '\0')
31 output[m++] = input[n++];
37 output[m++] = input[n++];