Dash:
[t2.git] / package / mail / metamail / 15_mm-2.7-csh.patch
blob204dd35a5ca2b348983032c9564d599cfdaf56a5
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../metamail/15_mm-2.7-csh.patch
5 # Copyright (C) 2004 - 2005 The T2 SDE Project
6 # Copyright (C) 1998 - 2003 ROCK Linux Project
7 #
8 # More information can be found in the files COPYING and README.
9 #
10 # This patch file is dual-licensed. It is available under the license the
11 # patched project is licensed under, as long as it is an OpenSource license
12 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
13 # of the GNU General Public License as published by the Free Software
14 # Foundation; either version 2 of the License, or (at your option) any later
15 # version.
16 # --- T2-COPYRIGHT-NOTE-END ---
18 --- mm2.7/src/metamail/mailto.c.cshfix Sat Oct 25 09:50:36 1997
19 +++ mm2.7/src/metamail/mailto.c Sat Oct 25 09:51:03 1997
20 @@ -200,9 +200,12 @@
23 TildeHelp() {
24 - char *pager = getenv("PAGER");
25 char TmpName[100], CmdBuf[150];
26 + char *pager;
27 FILE *fp;
29 + if ((pager = getenv("METAMAIL_PAGER")) == NULL)
30 + pager = getenv("PAGER");
32 strcpy(TmpName, tmpname());
33 fp = fopen(TmpName, "w");
34 --- mm2.7/src/bin/showexternal.cshfix Sat Oct 25 09:45:05 1997
35 +++ mm2.7/src/bin/showexternal Sat Oct 25 09:46:25 1997
36 @@ -19,6 +19,9 @@
37 if (! $?METAMAIL_TMPDIR) then
38 set METAMAIL_TMPDIR=/tmp
39 endif
40 +if (! $?METAMAIL_PAGER) then
41 + set METAMAIL_PAGER=more
42 +endif
43 if (! $?FTP) then
44 set FTP=ftp
45 endif
46 @@ -27,11 +30,19 @@
47 echo "Usage: showexternal body-file access-type name [site [directory [mode [server]]]]"
48 exit -1
49 endif
50 -set bodyfile=$1
51 +# Check argument integrity. Don't trust mail headers
52 +switch ("$1$2$3$4$5$6$7")
53 +case "*[ ]*":
54 + echo "Illegal white space in arguments -- possibly a mail bomb?!"
55 + echo "Command was:"
56 + echo \'$0\' \'$1\' \'$2\' \'$3\' \'$4\' \'$5\' \'$6\' \'$7\'
57 + exit 2
58 +endsw
59 +set bodyfile="$1"
60 set atype=`echo $2 | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
61 set name=$3
62 if ($#argv > 3) then
63 - set site=$4
64 + set site="$4"
65 else
66 set site=""
67 endif
68 @@ -41,12 +52,12 @@
69 set dir=""
70 endif
71 if ($#argv > 5) then
72 - set mode=$6
73 + set mode="$6"
74 else
75 set mode=""
76 endif
77 if ($#argv > 6) then
78 - set server=$7
79 + set server="$7"
80 else
81 set server=""
82 endif
83 @@ -96,7 +107,7 @@
86 sed -e 1,/^\$/d < $bodyfile >> ${METAMAIL_TMPDIR}/ext.junk.$$
87 - more ${METAMAIL_TMPDIR}/ext.junk.$$
88 + ${METAMAIL_PAGER} ${METAMAIL_TMPDIR}/ext.junk.$$
89 rm ${METAMAIL_TMPDIR}/ext.junk.$$
90 breaksw
91 default:
92 --- mm2.7/src/bin/showpartial.cshfix Sat Oct 25 09:46:37 1997
93 +++ mm2.7/src/bin/showpartial Sat Oct 25 09:47:24 1997
94 @@ -11,14 +11,14 @@
95 echo "Usage: showpartial file id partnum totalnum"
96 exit -1
97 endif
98 -set file=$1
99 +set file="$1"
100 # This next line is because message-id can contain weird chars
101 set id=`echo $2 | tr -d \!\$\&\*\(\)\|\'\"\;\/\<\>\\`
102 @ partnum = $3
103 if ($#argv == 3 || $4 == "") then
104 set totalnum=-1
105 else
106 - @ totalnum = $4
107 + @ totalnum = "$4"
108 endif
110 if (! -d $TREEROOT) then
111 --- mm2.7/src/bin/sun-message.csh.cshfix Sat Oct 25 09:49:16 1997
112 +++ mm2.7/src/bin/sun-message.csh Sat Oct 25 09:50:15 1997
113 @@ -8,6 +8,10 @@
114 mkdir /tmp/decode.$$
115 cd /tmp/decode.$$
117 +if (! $?METAMAIL_PAGER) then
118 + set METAMAIL_PAGER=more
119 +endif
121 if ($2 == "uuencode") then
122 uudecode $1
124 @@ -37,7 +41,7 @@
125 cd /tmp; /bin/rm -rf /tmp/decode.$$
126 exit 0
127 else if ($ans == 1) then
128 - more $fn
129 + ${METAMAIL_PAGER} $fn
130 else if ($ans == 2) then
131 set nfn = ""
132 echo -n "Save as: $HOME/"
133 @@ -53,7 +57,7 @@
134 set defans = "3"
136 else
137 - more $1
138 + ${METAMAIL_PAGER} $1
139 endif