]> diplodocus.org Git - nmh/blobdiff - uip/mhparse.c
Replace `if (p) free(p)' with `mh_xfree(p)'.
[nmh] / uip / mhparse.c
index c380969c994d581b44761f94c6e8f2af09af1b97..0c2c17cd49b01e797c50ee3928192f76245ecc2f 100644 (file)
@@ -660,8 +660,7 @@ get_ctinfo (char *cp, CT ct, int magic)
 
     /* down case the content type string */
     for (dp = ci->ci_type; *dp; dp++)
-       if (isalpha((unsigned char) *dp) && isupper ((unsigned char) *dp))
-           *dp = tolower ((unsigned char) *dp);
+        *dp = tolower ((unsigned char) *dp);
 
     while (isspace ((unsigned char) *cp))
        cp++;
@@ -699,8 +698,7 @@ get_ctinfo (char *cp, CT ct, int magic)
 
     /* down case the content subtype string */
     for (dp = ci->ci_subtype; *dp; dp++)
-       if (isalpha((unsigned char) *dp) && isupper ((unsigned char) *dp))
-           *dp = tolower ((unsigned char) *dp);
+        *dp = tolower ((unsigned char) *dp);
 
 magic_skip:
     while (isspace ((unsigned char) *cp))
@@ -3299,8 +3297,7 @@ parse_header_attrs (const char *filename, const char *fieldname,
 
        /* down case the attribute name */
        for (dp = cp; istoken ((unsigned char) *dp); dp++)
-           if (isalpha((unsigned char) *dp) && isupper ((unsigned char) *dp))
-               *dp = tolower ((unsigned char) *dp);
+            *dp = tolower ((unsigned char) *dp);
 
        for (up = dp; isspace ((unsigned char) *dp);)
            dp++;
@@ -4251,6 +4248,10 @@ noiconv:
     q = buffer;
     bufsize = sizeof(buffer);
     for (p = pm->pm_value; *p != '\0' && bufsize > 1; p++, q++, bufsize--) {
+        /* FIXME: !iscntrl should perhaps be isprint as that allows all
+         * classes bar cntrl, whereas the cntrl class can include those
+         * in space and blank.
+         * http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap07.html */
        if (isascii((unsigned char) *p) && !iscntrl((unsigned char) *p))
            *q = *p;
        else