X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/1513f7668c494c4583141d6115669b7198c14556..167e542b:/h/mime.h diff --git a/h/mime.h b/h/mime.h index 1a85b427..2f8a6a32 100644 --- a/h/mime.h +++ b/h/mime.h @@ -1,8 +1,6 @@ /* * mime.h -- definitions for MIME - * - * $Id$ */ #define VRSN_FIELD "MIME-Version" @@ -15,7 +13,9 @@ #define DISPO_FIELD "Content-Disposition" #define MD5_FIELD "Content-MD5" -#define isatom(c) (!isspace (c) && !iscntrl (c) && (c) != '(' \ +#define isatom(c) (isascii((unsigned char) c) \ + && !isspace ((unsigned char) c) \ + && !iscntrl ((unsigned char) c) && (c) != '(' \ && (c) != ')' && (c) != '<' && (c) != '>' \ && (c) != '@' && (c) != ',' && (c) != ';' \ && (c) != ':' && (c) != '\\' && (c) != '"' \ @@ -25,7 +25,9 @@ * Test for valid characters used in "token" * as defined in RFC2045 */ -#define istoken(c) (!isspace (c) && !iscntrl (c) && (c) != '(' \ +#define istoken(c) (isascii((unsigned char) c) \ + && !isspace ((unsigned char) c) \ + && !iscntrl ((unsigned char) c) && (c) != '(' \ && (c) != ')' && (c) != '<' && (c) != '>' \ && (c) != '@' && (c) != ',' && (c) != ';' \ && (c) != ':' && (c) != '\\' && (c) != '"' \