]> diplodocus.org Git - nmh/commitdiff
Unquoted addresses in mhshow and scan output. Suggested by
authorDavid Levine <levinedl@acm.org>
Tue, 14 Jul 2015 02:32:36 +0000 (22:32 -0400)
committerDavid Levine <levinedl@acm.org>
Tue, 14 Jul 2015 02:32:36 +0000 (22:32 -0400)
Anthony Bentley.

15 files changed:
etc/mhl.format
etc/mhl.headers
etc/mhl.reply
etc/mhl.replywithoutbody
etc/scan.MMDDYY
etc/scan.YYYYMMDD
etc/scan.curses
etc/scan.default
etc/scan.highlighted
etc/scan.mailx
etc/scan.size
etc/scan.time
etc/scan.timely
etc/scan.unseen
test/format/test-fmtdump

index 7f8a5672cedffac314d49ff96592ea5e11b93743..289f0b8ff689f0edca0f50ba971442ad07dacdba 100644 (file)
@@ -9,7 +9,7 @@ ignores=msgid,message-id,received,content-type,content-transfer-encoding,content
 Date:formatfield="%<(nodate{text})%{text}%|%(pretty{text})%>"
 To:
 cc:
 Date:formatfield="%<(nodate{text})%{text}%|%(pretty{text})%>"
 To:
 cc:
-From:decode
+From:formatfield="%(unquote(decode{text}))"
 Subject:decode
 :
 extras:nocomponent
 Subject:decode
 :
 extras:nocomponent
index 8fee181c8728751e61c7c7c6fa83835b923e5aa9..27a08d71c4c79d0f8a71e6dfda46b3d93d6b7c46 100644 (file)
@@ -10,7 +10,7 @@ ignores=msgid,message-id,received,content-type,content-transfer-encoding,content
 Date:formatfield="%<(nodate{text})%{text}%|%(pretty{text})%>"
 To:
 cc:
 Date:formatfield="%<(nodate{text})%{text}%|%(pretty{text})%>"
 To:
 cc:
-From:decode
+From:formatfield="%(unquote(decode{text}))"
 Subject:decode
 :
 extras:nocomponent
 Subject:decode
 :
 extras:nocomponent
index 3498263b03911b8fb098193d6fece51f731c8e50..dffc0d2f9e4991f642ab111d87f039f6db841683 100644 (file)
@@ -2,5 +2,5 @@
 ;
 ; default message filter for `repl' (repl -format)
 ;
 ;
 ; default message filter for `repl' (repl -format)
 ;
-from:nocomponent,formatfield="%(decode(friendly{text})) writes:"
+from:nocomponent,formatfield="%(unquote(decode(friendly{text}))) writes:"
 body:component="> ",overflowtext="> ",overflowoffset=0
 body:component="> ",overflowtext="> ",overflowoffset=0
index 6abeab38f0b2e4e413a07c800cfe4c7a5bdf7c7e..41421eaaf0ba735209dcb1c6c2699794f5b0e419 100644 (file)
@@ -2,4 +2,4 @@
 ;
 ; message filter for `repl' (repl -format) that excludes the message body
 ;
 ;
 ; message filter for `repl' (repl -format) that excludes the message body
 ;
-from:nocomponent,formatfield="%(decode(friendly{text})) writes:"
+from:nocomponent,formatfield="%(unquote(decode(friendly{text}))) writes:"
index dd20b2905a51583be7699998a3e8420f628158e8..f4a20bd598efb03c24901d1ccc9657722aa025f1 100644 (file)
@@ -5,6 +5,6 @@
 %;
 %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\
 %02(mon{date})/%02(mday{date})/%(void(year{date}))%02(modulo 100)%<{date} %|*%>\
 %;
 %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\
 %02(mon{date})/%02(mday{date})/%(void(year{date}))%02(modulo 100)%<{date} %|*%>\
-%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\
-%<(zero)%17(decode(friendly{from}))%>  \
+%<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\
+%<(zero)%17(unquote(decode(friendly{from})))%>  \
 %(decode{subject})%<{body}<<%{body}>>%>
 %(decode{subject})%<{body}<<%{body}>>%>
index 741681ded33bc3c34cf112288f247e385fc2b311..97016c2cfe69c77f310c4cc7d41d0c0f205feff1 100644 (file)
@@ -5,6 +5,6 @@
 %;
 %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\
 %4(year{date})-%02(mon{date})-%02(mday{date})%<{date} %|*%>\
 %;
 %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\
 %4(year{date})-%02(mon{date})-%02(mday{date})%<{date} %|*%>\
-%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\
-%<(zero)%17(decode(friendly{from}))%>  \
+%<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\
+%<(zero)%17(unquote(decode(friendly{from})))%>  \
 %(decode{subject})%<{body}<<%{body}>>%>
 %(decode{subject})%<{body}<<%{body}>>%>
index 913f2c010fbcfcb26fab1127a41c98c2826d3e6f..53f6bb69801087e607994fdce3501dcb40929f5e 100644 (file)
@@ -37,8 +37,8 @@
 %;
 %; If the message is from me, print out who the message was sent to.
 %; Otherwise, print out who it was from.
 %;
 %; If the message is from me, print out who the message was sent to.
 %; Otherwise, print out who it was from.
-%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\
-%<(zero)%17(decode(friendly{from}))%>  \
+%<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\
+%<(zero)%17(unquote(decode(friendly{from})))%>  \
 %;
 %; Print out the subject and any of th mesage body that will fit on the
 %; rest of the line.  After that, print the terminal reset code to reset
 %;
 %; Print out the subject and any of th mesage body that will fit on the
 %; rest of the line.  After that, print the terminal reset code to reset
index f898e86ca6f2faa9f07342541433555ceb015d7b..adca1fcbcc1df311b4e79115b5fbad60871e20b4 100644 (file)
@@ -6,6 +6,6 @@
 %;
 %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\
 %02(mon{date})/%02(mday{date})%<{date} %|*%>\
 %;
 %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\
 %02(mon{date})/%02(mday{date})%<{date} %|*%>\
-%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\
-%<(zero)%17(decode(friendly{from}))%>  \
+%<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\
+%<(zero)%17(unquote(decode(friendly{from})))%>  \
 %(decode{subject})%<{body}<<%{body}>>%>
 %(decode{subject})%<{body}<<%{body}>>%>
index 4bffe588e2661ad3f8d4be367ab85612a0437474..0e46f156ef6dc90cf1af7058bc5433ecf6121777 100644 (file)
@@ -36,6 +36,6 @@
 %<(unseen)%(zputlit(lit \e[36;40m))%>\
 %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\
 %02(mon{date})/%02(mday{date})%<{date} %|*%>\
 %<(unseen)%(zputlit(lit \e[36;40m))%>\
 %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\
 %02(mon{date})/%02(mday{date})%<{date} %|*%>\
-%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\
-%<(zero)%17(decode(friendly{from}))%>  \
+%<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\
+%<(zero)%17(unquote(decode(friendly{from})))%>  \
 %(decode{subject})%<{body}<<%{body}>>%>%(zputlit(lit \e[m))
 %(decode{subject})%<{body}<<%{body}>>%>%(zputlit(lit \e[m))
index 27d18d324638c4766de4679c40edf935b540b9ed..942e2653d13ee75725c7ad883fb0692b96aa288c 100644 (file)
@@ -2,8 +2,8 @@
 %<{status} %|N%>\
 %<{replied}R%?{encrypted}E%| %>\
 %4(msg) \
 %<{status} %|N%>\
 %<{replied}R%?{encrypted}E%| %>\
 %4(msg) \
-%<(mymbox{from})%<{to}To: %13(decode(friendly{to}))%>%>\
-%<(zero)%17(decode(friendly{from}))%> \
+%<(mymbox{from})%<{to}To: %13(unquote(decode(friendly{to})))%>%>\
+%<(zero)%17(unquote(decode(friendly{from})))%> \
 %3(day{date}) %3(month{date}) %02(mday{date}) \
 %02(hour{date}):%02(min{date}) \
 %(decode{subject})
 %3(day{date}) %3(month{date}) %02(mday{date}) \
 %02(hour{date}):%02(min{date}) \
 %(decode{subject})
index a6b6698c7a3752eb950f7312d06d104d281970b4..9b48078c40662b49acf0c3b8be554997ddd29f1d 100644 (file)
@@ -1,6 +1,6 @@
 %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\
 %02(mon{date})/%02(mday{date})%<{date} %|*%>\
 %5(size) \
 %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\
 %02(mon{date})/%02(mday{date})%<{date} %|*%>\
 %5(size) \
-%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\
-%<(zero)%17(decode(friendly{from}))%>  \
+%<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\
+%<(zero)%17(unquote(decode(friendly{from})))%>  \
 %(decode{subject})%<{body}<<%{body}%>
 %(decode{subject})%<{body}<<%{body}%>
index ee54a523f30c059ee62ef6e239688980adc66695..ff3762850d64a1ce8045eaa37431cd586a82bd3f 100644 (file)
@@ -2,6 +2,6 @@
 %02(mon{date})/%02(mday{date}) \
 %02(hour{date}):%02(min{date})%3(tzone{date})\
 %<{date} %|*%>\
 %02(mon{date})/%02(mday{date}) \
 %02(hour{date}):%02(min{date})%3(tzone{date})\
 %<{date} %|*%>\
-%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\
-%<(zero)%17(decode(friendly{from}))%>  \
+%<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\
+%<(zero)%17(unquote(decode(friendly{from})))%>  \
 %(decode{subject})%<{body}<<%{body}%>
 %(decode{subject})%<{body}<<%{body}%>
index 06c068c202270c83694b4bfcaed60b3b01db134e..de09b8b7f4f441fc7f8d5fc7243b14e095f6d1c8 100644 (file)
@@ -5,6 +5,6 @@
 %?(gt 86400) %(day{date}) %|\
 %02(hour{date}):%02(min{date})%>\
 %<{date} %|*%>\
 %?(gt 86400) %(day{date}) %|\
 %02(hour{date}):%02(min{date})%>\
 %<{date} %|*%>\
-%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\
-%<(zero)%17(decode(friendly{from}))%>  \
+%<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\
+%<(zero)%17(unquote(decode(friendly{from})))%>  \
 %(decode{subject})%<{body}<<%{body}%>
 %(decode{subject})%<{body}<<%{body}%>
index d1cd195c996f35313b64ebf784744bfe3d80da78..1b254d4defe5bdd8192c1302580e2e81879d85fc 100644 (file)
@@ -1,5 +1,5 @@
 %4(msg)%<(cur)+%| %>%<(unseen)U%| %>%<{replied}-%?{encrypted}E%| %>\
 %02(mon{date})/%02(mday{date})%<{date} %|*%>\
 %4(msg)%<(cur)+%| %>%<(unseen)U%| %>%<{replied}-%?{encrypted}E%| %>\
 %02(mon{date})/%02(mday{date})%<{date} %|*%>\
-%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\
-%<(zero)%17(decode(friendly{from}))%>  \
+%<(mymbox{from})%<{to}To:%14(unquote(decode(friendly{to})))%>%>\
+%<(zero)%17(unquote(decode(friendly{from})))%>  \
 %(decode{subject})%<{body}<<%{body}>>%>
 %(decode{subject})%<{body}<<%{body}>>%>
index 5680a5b1fbbceafcafe9108a3084eebe8392387d..73fd14de19d84174583d4b752650ea71b6645e27 100755 (executable)
@@ -107,9 +107,68 @@ L10:       CHAR '\n'
 EOF
 
 run_prog $fmtdump >$actual 2>&1
 EOF
 
 run_prog $fmtdump >$actual 2>&1
-check $expected $actual 'keep first'
+check $expected $actual
 
 # check -form
 
 # check -form
+cat >$expected <<EOF
+       LV_DAT, value dat[0]
+       NUMF, width 4, fill ' '
+       LV_DAT, value dat[1]
+       IF_V_NE 0 continue else goto L0
+       CHAR '+'
+       GOTO L1
+L0:    CHAR ' '
+L1:    LS_COMP, comp "replied"
+       IF_S continue else goto L2
+       CHAR '-'
+       GOTO L3
+L2:    LS_COMP, comp "encrypted"
+       IF_S continue else goto L4
+       CHAR 'E'
+L3:    GOTO L5
+L4:    CHAR ' '
+L5:    PARSEDATE, c_name "date", c_type <DATE>
+       LV_MON, c_name "date", c_type <DATE>
+       NUMF, width 2, fill '0'
+       CHAR '/'
+       PARSEDATE, c_name "date", c_type <DATE>
+       LV_MDAY, c_name "date", c_type <DATE>
+       NUMF, width 2, fill '0'
+       LS_COMP, comp "date", c_type <DATE>
+       IF_S continue else goto L6
+       CHAR ' '
+       GOTO L7
+L6:    CHAR '*'
+L7:    MYMBOX, c_name "from", c_type <ADDR>
+       LV_COMPFLAG, comp "from", c_type <ADDR>
+       IF_V_NE 0 continue else goto L8
+       LS_COMP, comp "to", c_type <ADDR>
+       IF_S continue else goto L8
+       LIT "To:"
+       PARSEADDR, c_name "to", c_type <ADDR>
+       LS_FRIENDLY, c_name "to", c_type <ADDR>
+       FT_LS_DECODE
+       
+       STRF, width 14, fill ' '
+L8:    IF_V_EQ 0 continue else goto L9
+       PARSEADDR, c_name "from", c_type <ADDR>
+       LS_FRIENDLY, c_name "from", c_type <ADDR>
+       FT_LS_DECODE
+       
+       STRF, width 17, fill ' '
+L9:    LIT "  "
+       LS_COMP, comp "subject"
+       FT_LS_DECODE
+       STR
+       LS_COMP, comp "body"
+       IF_S continue else goto L10
+       LIT "<<"
+       COMP, comp "body"
+       LIT ">>"
+L10:   CHAR '\n'
+       DONE
+EOF
+
 run_prog $fmtdump -form "$MH_INST_DIR${nmhetcdir}/scan.default" >$actual 2>&1
 check $expected $actual
 
 run_prog $fmtdump -form "$MH_INST_DIR${nmhetcdir}/scan.default" >$actual 2>&1
 check $expected $actual