]> diplodocus.org Git - nmh/commitdiff
Whoops, forgot to TEST THIS OUT first.
authorKen Hornstein <kenh@pobox.com>
Sun, 2 Mar 2014 05:07:10 +0000 (00:07 -0500)
committerKen Hornstein <kenh@pobox.com>
Sun, 2 Mar 2014 05:07:10 +0000 (00:07 -0500)
uip/mhbuildsbr.c
uip/mhlistsbr.c
uip/mhoutsbr.c
uip/mhshowsbr.c

index a5b7dfefd195014420e769571953080cf37a0128..e2bcf392e5543509a0bbb053f64c41e7853ac076 100644 (file)
@@ -1164,7 +1164,7 @@ compose_content (CT ct)
 
                        for (pm = ci->ci_first_pm; pm; pm = pm->pm_next) {
                            snprintf (bp, buflen, "%s%s=\"%s\"", s,
 
                        for (pm = ci->ci_first_pm; pm; pm = pm->pm_next) {
                            snprintf (bp, buflen, "%s%s=\"%s\"", s,
-                                     pm->pm_name, get_param_value(pm));
+                                     pm->pm_name, get_param_value(pm, '?'));
                            len = strlen (bp);
                            bp += len;
                            buflen -= len;
                            len = strlen (bp);
                            bp += len;
                            buflen -= len;
index 45aa89f05215f3055017f1f10f81b955ee7ed239..f5676a4990e2751fcc62e1ac2b327ba468e786a4 100644 (file)
@@ -258,7 +258,8 @@ list_debug (CT ct)
     /* print parsed parameters attached to content type */
     fprintf (stderr, "    parameters\n");
     for (pm = ci->ci_first_pm; pm; pm = pm->pm_next)
     /* print parsed parameters attached to content type */
     fprintf (stderr, "    parameters\n");
     for (pm = ci->ci_first_pm; pm; pm = pm->pm_next)
-       fprintf (stderr, "      %s=\"%s\"\n", pm->pm_name, get_param_value(pm));
+       fprintf (stderr, "      %s=\"%s\"\n", pm->pm_name,
+                get_param_value(pm, '?'));
 
     /* print internal flags for type/subtype */
     fprintf (stderr, "    type 0x%x subtype 0x%x params 0x%x\n",
 
     /* print internal flags for type/subtype */
     fprintf (stderr, "    type 0x%x subtype 0x%x params 0x%x\n",
index cb530e1eb2c1a822a7dd898317a06fe00ff76519..9f024e08592c87708dc8af0bdf9a20050096c9f2 100644 (file)
@@ -83,9 +83,8 @@ output_content (CT ct, FILE *out)
     CI ci = &ct->c_ctinfo;
     char *boundary = "", *cp;
 
     CI ci = &ct->c_ctinfo;
     char *boundary = "", *cp;
 
-    if ((cp = get_param(ci->ci_first_pm, "boundary, '-', 0)))
+    if ((cp = get_param(ci->ci_first_pm, "boundary", '-', 0)))
        boundary = cp;
        boundary = cp;
-    }
 
     /*
      * Output all header fields for this content
 
     /*
      * Output all header fields for this content
@@ -252,17 +251,22 @@ writeExternalBody (CT ct, FILE *out)
                continue;
 
            case 'N':
                continue;
 
            case 'N':
-               for (pm = ci2->ci_first_pm; pm; pm = pm->pm_next)
-                   if (!strcasecmp (pm->pm_name, "name")) {
-                       fprintf (out, "%s", pm->pm_value);
-                       break;
-                   }
+               cp = get_param(ci2->ci_first_pm, "name", '_', 0);
+               if (cp) {
+                   fputs (cp, out);
+                   free (cp);
+               }
                continue;
 
            case 'T':
                fprintf (out, "%s/%s", ci2->ci_type, ci2->ci_subtype);
                continue;
 
            case 'T':
                fprintf (out, "%s/%s", ci2->ci_type, ci2->ci_subtype);
-               for (pm = ci2->ci_first_pm; pm; pm = pm->pm_next)
-                   fprintf (out, "; %s=\"%s\"", pm->pm_name, pm->pm_value);
+               cp = output_params(strlen(ci2->ci_type) +
+                                  strlen(ci2->ci_subtype) + 1,
+                                  ci2->ci_first_pm, NULL, 0);
+               if (cp) {
+                   fputs (cp, out);
+                   free (cp);
+               }
                continue;
 
            case 'n':
                continue;
 
            case 'n':
index 416fe938a321dfcfee5b2c367ea116247cb9595e..1682ce802aed962f0b23e4a97dcdfca3c37bd4b9 100644 (file)
@@ -341,7 +341,7 @@ show_content_aux (CT ct, int serial, int alternate, char *cp, char *cracked)
 
                for (pm = ci->ci_first_pm; pm; pm = pm->pm_next) {
                    snprintf (bp, buflen, "%s%s=\"%s\"", s, pm->pm_name,
 
                for (pm = ci->ci_first_pm; pm; pm = pm->pm_next) {
                    snprintf (bp, buflen, "%s%s=\"%s\"", s, pm->pm_name,
-                             get_param_value(pm));
+                             get_param_value(pm, '?'));
                    len = strlen (bp);
                    bp += len;
                    buflen -= len;
                    len = strlen (bp);
                    bp += len;
                    buflen -= len;
@@ -849,7 +849,7 @@ show_multi_aux (CT ct, int serial, int alternate, char *cp)
 
                for (pm = ci->ci_first_pm; pm; pm = pm->pm_next) {
                    snprintf (bp, buflen, "%s%s=\"%s\"", s, pm->pm_name,
 
                for (pm = ci->ci_first_pm; pm; pm = pm->pm_next) {
                    snprintf (bp, buflen, "%s%s=\"%s\"", s, pm->pm_name,
-                             get_param_value(pm));
+                             get_param_value(pm, '?'));
                    len = strlen (bp);
                    bp += len;
                    buflen -= len;
                    len = strlen (bp);
                    bp += len;
                    buflen -= len;