From: David Levine Date: Sat, 1 Mar 2014 14:32:20 +0000 (-0600) Subject: Fix to commit a2806483a53fcdb62ca8e2bec4f4e023355f4470 X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/e0472796d8671e81c1312e414dda5e04ba2115df?hp=-c Fix to commit a2806483a53fcdb62ca8e2bec4f4e023355f4470 to properly handle quoting when text follows quoted text in a mhshow display string. --- e0472796d8671e81c1312e414dda5e04ba2115df diff --git a/test/mhshow/test-textcharset b/test/mhshow/test-textcharset index 5d358d92..4e8cc37e 100755 --- a/test/mhshow/test-textcharset +++ b/test/mhshow/test-textcharset @@ -58,6 +58,7 @@ cat >>"$MH" <<'EOF' mhshow-show-text/plain: echo %{charset} EOF + # check expansion of %{charset} by itself msgfile=`mhpath new` cat >"$msgfile" <<'EOF' @@ -86,6 +87,7 @@ EOF run_prog mhshow -nopause last >"$actual" 2>&1 check "$expected" "$actual" + # check expansion of empty %{charset} by itself msgfile=`mhpath new` cat >"$msgfile" <<'EOF' @@ -114,6 +116,7 @@ EOF run_prog mhshow -nopause last >"$actual" 2>&1 check "$expected" "$actual" + grep -v 'mhshow-show-text/plain:' "$MH" >"$MH.new" mv -f "$MH.new" "$MH" cat >>"$MH" <<'EOF' @@ -135,6 +138,7 @@ EOF run_prog mhshow -nopause prev >"$actual" 2>&1 check "$expected" "$actual" + # check expansion of empty embedded %{charset} with no text following cat >"$expected" <<'EOF' Date: Sun, 18 Dec 2005 00:52:39 +0100 @@ -150,6 +154,7 @@ EOF run_prog mhshow -nopause last >"$actual" 2>&1 check "$expected" "$actual" + sed -e 's%\(mhshow-show-text/plain:.*\)%\1 file%' "$MH" >"$MH.new" mv -f "$MH.new" "$MH" @@ -168,6 +173,7 @@ EOF run_prog mhshow -nopause prev >"$actual" 2>&1 check "$expected" "$actual" + # check expansion of empty embedded %{charset} with text following cat >"$expected" <<'EOF' Date: Sun, 18 Dec 2005 00:52:39 +0100 @@ -183,6 +189,7 @@ EOF run_prog mhshow -nopause last >"$actual" 2>&1 check "$expected" "$actual" + sed -e 's/charset/method/g' "$MH" >"$MH.new" mv -f "$MH.new" "$MH" @@ -214,6 +221,7 @@ EOF run_prog mhshow -nopause last >"$actual" 2>&1 check "$expected" "$actual" + sed -e 's/method/unknown/g' "$MH" >"$MH.new" mv -f "$MH.new" "$MH" @@ -246,4 +254,37 @@ run_prog mhshow -nopause last >"$actual" 2>&1 check "$expected" "$actual" +grep -v '^mhshow-show-text/plain: ' "$MH" >>"$MH.new" +mv -f "$MH.new" "$MH" +cat >>"$MH" <"$msgfile" <<'EOF' +From: foo@example.edu +To: bar@example.edu +Subject: check parameter value quoting with text following +MIME-Version: 1.0 +Content-Type: text/plain +Date: Sun, 18 Dec 2005 00:52:39 +0100 + +This is a test. +EOF + +cat >"$expected" <<'EOF' +Date: Sun, 18 Dec 2005 00:52:39 +0100 +To: bar@example.edu +From: foo@example.edu +Subject: check parameter value quoting with text following + +MIME-Version: 1.0 + +EOF + +run_prog mhshow -nopause last >"$actual" 2>&1 +check "$expected" "$actual" + + exit $failed diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index ab87831f..eabf387c 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -1008,9 +1008,8 @@ parse_display_string (CT ct, char *cp, int *xstdin, int *xlist, int *xpause, if (! found_quote) { *bp++ = '\''; buflen--; + quoted = 0; } - - quoted = 0; } } } else {