From: Ralph Corderoy Date: Tue, 16 May 2017 10:21:50 +0000 (+0100) Subject: sbr/unquote.c: Move prototype from h/prototypes.h to new header. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/394c1797728f21b699a9cd8bfc16ea70f384c1e0?ds=inline;hp=--cc sbr/unquote.c: Move prototype from h/prototypes.h to new header. --- 394c1797728f21b699a9cd8bfc16ea70f384c1e0 diff --git a/Makefile.am b/Makefile.am index 53eb99e7..5ac9ea54 100644 --- a/Makefile.am +++ b/Makefile.am @@ -366,6 +366,7 @@ noinst_HEADERS = \ sbr/makedir.h \ sbr/message_id.h \ sbr/mime_type.h \ + sbr/unquote.h \ thirdparty/jsmn/jsmn.h \ uip/mhfree.h \ uip/mhoutsbr.h \ diff --git a/h/prototypes.h b/h/prototypes.h index 9a2b41a4..97c6cc13 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -345,22 +345,6 @@ int ssequal (const char *, const char *); int stringdex (char *, char *); char *trimcpy (char *); -/* - * Remove quotes and quoted-pair sequences from RFC-5322 atoms. - * - * Currently the actual algorithm is simpler than it technically should - * be: any quotes are simply eaten, unless they're preceded by the escape - * character (\). This seems to be sufficient for our needs for now. - * - * Arguments: - * - * input - The input string - * output - The output string; is assumed to have at least as much - * room as the input string. At worst the output string will - * be the same size as the input string; it might be smaller. - * - */ -void unquote_string(const char *input, char *output); int uprf (const char *, const char *); int vfgets (FILE *, char **); diff --git a/sbr/datetime.c b/sbr/datetime.c index a3e0e7a3..a5f6c77b 100644 --- a/sbr/datetime.c +++ b/sbr/datetime.c @@ -10,6 +10,7 @@ #include #include "h/tws.h" #include "h/utils.h" +#include "unquote.h" /* * This doesn't try to support all of the myriad date-time formats diff --git a/sbr/encode_rfc2047.c b/sbr/encode_rfc2047.c index 238882dc..75b5808f 100644 --- a/sbr/encode_rfc2047.c +++ b/sbr/encode_rfc2047.c @@ -9,6 +9,7 @@ #include #include #include +#include "unquote.h" /* * List of headers that contain addresses and as a result require special diff --git a/sbr/fmt_scan.c b/sbr/fmt_scan.c index 39d549a5..c75db3ec 100644 --- a/sbr/fmt_scan.c +++ b/sbr/fmt_scan.c @@ -14,6 +14,7 @@ #include #include #include +#include "unquote.h" #ifdef HAVE_SYS_TIME_H # include diff --git a/sbr/unquote.c b/sbr/unquote.c index b20c829c..b6411e11 100644 --- a/sbr/unquote.c +++ b/sbr/unquote.c @@ -7,6 +7,7 @@ */ #include +#include "unquote.h" /* * Remove quotes (and handle escape strings) from RFC 5322 quoted-strings. diff --git a/sbr/unquote.h b/sbr/unquote.h new file mode 100644 index 00000000..bd76e8e7 --- /dev/null +++ b/sbr/unquote.h @@ -0,0 +1,22 @@ +/* unquote.h -- Handle quote removal and quoted-pair strings on + * RFC 2822-5322 atoms. + * + * This code is Copyright (c) 2017, by the authors of nmh. See the + * COPYRIGHT file in the root directory of the nmh distribution for + * complete copyright information. + */ + +/* Remove quotes and quoted-pair sequences from RFC-5322 atoms. + * + * Currently the actual algorithm is simpler than it technically should + * be: any quotes are simply eaten, unless they're preceded by the escape + * character (\). This seems to be sufficient for our needs for now. + * + * Arguments: + * + * input - The input string + * output - The output string; is assumed to have at least as much + * room as the input string. At worst the output string + * will be the same size as the input string; it might be + * smaller. */ +void unquote_string(const char *input, char *output);