From: Ken Hornstein Date: Sun, 2 Mar 2014 05:07:10 +0000 (-0500) Subject: Whoops, forgot to TEST THIS OUT first. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/fda43c337684641866e4c5890ff3af41cfa72fdd?hp=807311a9e1ff5f0db6b29e1c97c7e87245c8af66 Whoops, forgot to TEST THIS OUT first. --- diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index a5b7dfef..e2bcf392 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -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, - pm->pm_name, get_param_value(pm)); + pm->pm_name, get_param_value(pm, '?')); len = strlen (bp); bp += len; buflen -= len; diff --git a/uip/mhlistsbr.c b/uip/mhlistsbr.c index 45aa89f0..f5676a49 100644 --- a/uip/mhlistsbr.c +++ b/uip/mhlistsbr.c @@ -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) - 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", diff --git a/uip/mhoutsbr.c b/uip/mhoutsbr.c index cb530e1e..9f024e08 100644 --- a/uip/mhoutsbr.c +++ b/uip/mhoutsbr.c @@ -83,9 +83,8 @@ output_content (CT ct, FILE *out) 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; - } /* * Output all header fields for this content @@ -252,17 +251,22 @@ writeExternalBody (CT ct, FILE *out) 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); - 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': diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index 416fe938..1682ce80 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -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, - get_param_value(pm)); + get_param_value(pm, '?')); 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, - get_param_value(pm)); + get_param_value(pm, '?')); len = strlen (bp); bp += len; buflen -= len;