home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / mail / elm / elm2.4.p24a.Z / elm2.4.p24a
Encoding:
Text File  |  1994-09-23  |  65.1 KB  |  2,097 lines

  1. Subject: elm 2.4 Patch #24a
  2. Date: Fri Sep 23 21:43:13 EDT 1994
  3. Summary: This is an official patch for elm 2.4 system.  Please apply it.
  4. Priority: LOW
  5.  
  6. =========================================================
  7. Patch Set - Patches 24: Tue Sep 20 14:01:13 EDT 1994
  8. Elm 2.4PL23 -> Elm 2.4PL24
  9.  
  10. Remove autoreply/arepdaem, its a security hole
  11. From: Syd
  12.  
  13. Fix where buffer was not getting null terminated during its
  14. construction, so the strcat failed (due to garbage data existing in the
  15. array at malloc() time).
  16. From: lm@yallara.cs.rmit.oz.au (Luke Mewburn)
  17.  
  18. Fix ANSI prototype stripping macro
  19. From: "Tom Moore" <tmoore@fievel.DaytonOH.NCR.COM>
  20.  
  21. fixed ReadCh() to recover from EINTR and EAGAIN instead
  22. of just returning an unexpected EOF.
  23. From: Jukka Ukkonen <ukkonen@csc.fi>
  24.  
  25. Replaced the get_tz_mins() routine in lib/get_tz.c with a portable
  26. version that requires no configuration.  Rewrote the test case in
  27. lib/get_tz.c, and also wrote in support to simplify configuration
  28. tests.  Dropped TZMINS_USE_XXXX configuration parameter.  Simplified
  29. timezone determination in Configure.  The new get_tz_mins() introduces
  30. two side effects.  First it steps on the static data returned by
  31. localtime().  Second, it uses a routine in lib/date_util.c, which
  32. requires debug initializations.  Rewrote get_arpa_date() to work around
  33. the first issue.  Rather than doing the same for lib/strftime.c, just
  34. removed the timezone stuff with a conditional compile.  Elm does not
  35. use it.  Added debugging initializations to util/fastmail.c.
  36. From: chip@chinacat.unicom.com (Chip Rosenthal)
  37.  
  38. I made the following changes to elm 2.4pl23 module pmalloc.c after testing on
  39. a DEC Alpha running OSF1 v1.3.  The difficulty is that the Alpha hardware
  40. requires certain alignment for some operations which was not supplied by
  41. pmalloc (8 byte for addresses instead of 4 byte).  I made a simple minded
  42. change to pmalloc.c to force alignment of the allocated data block to be
  43. adequate on DEC Alpha OSF1.
  44. From: jim@lime.rsmas.miami.edu (Jim Brown)
  45.  
  46. detect whether atol() is a macro
  47. From: Mitch DSouza <m.dsouza@mrc-applied-psychology.cambridge.ac.uk>
  48.  
  49. Recognize the "#$HDR" magic cookie as the header to place in the
  50. user's elmrc file rather than hardwiring a minimally helpful
  51. string into the binary.
  52. From: chip@chinacat.unicom.com (Chip Rosenthal)
  53.  
  54. Fix Elm looping if an EOF is received.
  55. From: Gregory Neil Shapiro <gshapiro@WPI.EDU>
  56.  
  57. There is a bug in the alias-system of elm-2.4.23 that did not appear in
  58. elm-2.4.21. When searching for a string in the alias-table with the '//'
  59. command, elm sometimes gets a segmentation fault. With help of a debugger,
  60. I found that the function shift_lower gets a NULL argument. A fix is
  61. appended, but maybe the problem lies elsewhere.
  62. From: Sjaak Schilperoort <J.W.Schilperoort@research.ptt.nl>
  63.  
  64. The latest Linux shared library (4.5.8) "catches" a double fclose()
  65. by generating a SIGSEGV.  :-/
  66. From: fin!chip@dg-rtp.dg.com (Chip Salzenberg)
  67.  
  68. Fix a line of debug output that is too long
  69. From: "C.R. Ritson" <C.R.Ritson@newcastle.ac.uk>
  70.  
  71. Here are some more of fixes to correctly call fflush() and unlock() in sequence.
  72. From: Jukka Ukkonen <ukkonen@csc.fi>
  73.  
  74. I had to put in some changes to builtin+ to allow it to display
  75. 8-bit letters as they should when the message has been sent
  76. through a real 8-bit channel like ESMTP with 8bit MIME Content-
  77. Transfer-Encoding.
  78. From: Jukka Ukkonen <ukkonen@csc.fi>
  79.  
  80. Tune the Ultrix fix for ispell
  81. From: Bill Gianopoulos <wag@sccux1.msd.ray.com>
  82.  
  83. Solaris 2.3 can return EACCES or EEXIST for lockfile already existing.
  84. From: xcea@uxa.ecn.bgu.edu (Chad Adams)
  85.  
  86. Below are the changes required to compile/link elm 2.4 pl23 under
  87. QNX 4.2 with the Watcom 9.5 compiler (very picky).
  88. From: "Brian Campbell" <brianc@quantum>
  89.  
  90. In utils/from.c there was a conditionalized declaration of
  91. getpwuid() which was triggered by the environment being non-
  92. POSIX instead of non-STDC.
  93. From: Jukka Antero Ukkonen <ukkonen@csc.fi>
  94.  
  95. There was a typo in src/curses.c. An include read out like
  96. "# include <vararg.h>" though the file name should have been
  97. varargs.h.
  98. From: Jukka Antero Ukkonen <ukkonen@csc.fi>
  99.  
  100. Just a minor fix to an impossible character comparison.
  101. From: Jukka Ukkonen <ukkonen@csc.fi>
  102.  
  103. I found a few months old patch I have not sent you before (I guess).
  104. It avoids unknowingly confusing some too rigidly and simple mindedly
  105. coded mailers with weird settings like
  106.  
  107.     charset=us-ascii and textencoding=8bit
  108.  
  109. This patch will force 7bit encoding with charset=us-ascii.
  110. E.g. older versions of pine will dump core on 8bit & us-ascii.
  111. From: Jukka Ukkonen <ukkonen@csc.fi>
  112.  
  113. I had to add a region of conditional compilation around "defs.h"
  114. to make Configure work correctly with the TZNAME_USE_xxxx stuff.
  115. From: Jukka Ukkonen <ukkonen@csc.fi>
  116.  
  117. The "copy_message" function in src/fileio.c incorrectly computes the
  118. size of the message.  The "bytes_seen" variable currently counts all
  119. bytes in the message ***including the message header*** when it should
  120. only be counting the bytes in the actual body of the message.
  121. From: Thomas Dwyer III <tomiii@mtu.edu>
  122.  
  123. Extra } in edit_mailbox removed.
  124. From: Jan.Djarv@sa.erisoft.se (Jan Djarv)
  125.  
  126. Add an fflush to detect over quota on file saves.
  127. From: Larry Schwimmer <rosebud@cyclone.Stanford.EDU>
  128.  
  129. Block sigwinch when in the external pager.
  130. From: jwa@yog-sothoth.dcrt.nih.gov (James W. Adams)
  131.  
  132. Work around null from names by looking to see whether the second or
  133. third field is a valid month and using that to determine if there
  134. is an address.
  135. From: alex@samwise.dccs.upenn.edu (Alex Garthwaite)
  136.  
  137. Fix up Solaris and SVR4 timeout signal handling
  138. From: Syd
  139.  
  140. Add extern declaration of strerror to avoid compiler warning.
  141. From: Jan.Djarv@sa.erisoft.se (Jan Djarv)
  142.  
  143. Moved #defines for SETJMP & LONGJMP from src/editmsg.c to hdrs/defs.h and
  144. used them instead of (set|long)jmp directly. This makes the usage consistent
  145. and Solaris 2.3 behaves correctly w.r.t stop/continue.
  146. From: Jan.Djarv@sa.erisoft.se (Jan Djarv)
  147.  
  148.  
  149. Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your elm source
  150.     directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
  151.     If you don't have the patch program, apply the following by hand,
  152.     or get patch (version 2.0, latest patchlevel).
  153.  
  154.     After patching:
  155.         apply patch 24b and 24c
  156.  
  157.     If patch indicates that patchlevel is the wrong version, you may need
  158.     to apply one or more previous patches, or the patch may already
  159.     have been applied.  See the patchlevel.h file to find out what has or
  160.     has not been applied.  In any event, don't continue with the patch.
  161.  
  162.     If you are missing previous patches they can be obtained from our:
  163.     archive server.
  164.  
  165.     Syd Weinstein
  166.     elm@Myxa.com
  167.  
  168.     The patches are available from the dsinc archive server
  169.     Send the following message to archive-server@Myxa.com for
  170.     a list of available patches:
  171.  
  172.     Subject: patch list
  173.     send index elm
  174.  
  175.  
  176.  
  177. Index: hdrs/patchlevel.h
  178. Prereq: "23"
  179. *** ../elm2.4/hdrs/patchlevel.h    Sun Sep 26 22:14:40 1993
  180. --- hdrs/patchlevel.h    Tue Sep 20 13:59:41 1994
  181. ***************
  182. *** 1 ****
  183. ! #define PATCHLEVEL "23"
  184. --- 1 ----
  185. ! #define PATCHLEVEL "24"
  186.  
  187. Index: Configure
  188. Prereq: 5.36
  189. *** ../elm2.4/Configure    Sun Sep 26 22:14:42 1993
  190. --- Configure    Mon May 30 12:55:55 1994
  191. ***************
  192. *** 8,14 ****
  193.   # and edit it to reflect your system.  Some packages may include samples
  194.   # of config.h for certain machines, so you might look for one of those.)
  195.   #
  196. ! # $Header: /home/syd/elm.rel/RCS/Configure,v 5.36 1993/09/27 01:51:38 syd Exp $
  197.   #
  198.   # Yes, you may rip this off to use in other distribution packages.
  199.   # (Note: this Configure script was generated automatically.  Rather than
  200. --- 8,14 ----
  201.   # and edit it to reflect your system.  Some packages may include samples
  202.   # of config.h for certain machines, so you might look for one of those.)
  203.   #
  204. ! # $Header: /home/syd/elm.rel/RCS/Configure,v 5.38 1994/05/30 16:55:46 syd Exp $
  205.   #
  206.   # Yes, you may rip this off to use in other distribution packages.
  207.   # (Note: this Configure script was generated automatically.  Rather than
  208. ***************
  209. *** 261,267 ****
  210.   shsharp=''
  211.   sharpbang=''
  212.   tmpdir=''
  213. - tzmins_handling=''
  214.   tzname_handling=''
  215.   use_pmake=''
  216.   xencf=''
  217. --- 261,266 ----
  218. ***************
  219. *** 704,780 ****
  220.   esac
  221.   rmlist="$rmlist loc"
  222.   
  223. - : set up shell script to do ~ expansion
  224. - cat >filexp <<EOSS
  225. - $startsh
  226. - : expand filename
  227. - case "\$1" in
  228. -  ~/*|~)
  229. -     echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
  230. -     ;;
  231. -  ~*)
  232. -     if $test -f /bin/csh; then
  233. -     /bin/csh -f -c "glob \$1"
  234. -     echo ""
  235. -     else
  236. -     name=\`$expr x\$1 : '..\([^/]*\)'\`
  237. -     dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
  238. -     if $test ! -d "\$dir"; then
  239. -         me=\`basename \$0\`
  240. -         echo "\$me: can't locate home directory for: \$name" >&2
  241. -         exit 1
  242. -     fi
  243. -     case "\$1" in
  244. -     */*)
  245. -         echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
  246. -         ;;
  247. -     *)
  248. -         echo \$dir
  249. -         ;;
  250. -     esac
  251. -     fi
  252. -     ;;
  253. - *)
  254. -     echo \$1
  255. -     ;;
  256. - esac
  257. - EOSS
  258. - chmod +x filexp
  259. - $eunicefix filexp
  260. - : determine where public executables go
  261. - case "$bin" in
  262. - '')
  263. -     dflt=`loc . /bin /usr/local/bin /usr/lbin /usr/local /usr/bin`
  264. -     ;;
  265. - *)  dflt="$bin"
  266. -     ;;
  267. - esac
  268. - cont=true
  269. - while $test "$cont" ; do
  270. -     echo " "
  271. -     rp="Where do you want to put the public executables? [$dflt]"
  272. -     $echo $n "$rp $c"
  273. -     . myread
  274. -     bin="$ans"
  275. -     bin=`filexp $bin`
  276. -     if test -d $bin; then
  277. -     cont=''
  278. -     else
  279. -     case "$fastread" in
  280. -     yes) dflt=y;;
  281. -     *) dflt=n;;
  282. -     esac
  283. -     rp="Directory $bin doesn't exist.  Use that name anyway? [$dflt]"
  284. -     $echo $n "$rp $c"
  285. -     . myread
  286. -     dflt=''
  287. -     case "$ans" in
  288. -     y*) cont='';;
  289. -     esac
  290. -     fi
  291. - done
  292.   : see if date exists, if so, init c_date
  293.   if $test ! "x$date" = "x" ; then
  294.       c_date=`LANGUAGE= $date`
  295. --- 703,708 ----
  296. ***************
  297. *** 1034,1039 ****
  298. --- 962,1005 ----
  299.       passcat='cat /etc/passwd'
  300.   fi
  301.   
  302. + : set up shell script to do ~ expansion
  303. + cat >filexp <<EOSS
  304. + $startsh
  305. + : expand filename
  306. + case "\$1" in
  307. +  ~/*|~)
  308. +     echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
  309. +     ;;
  310. +  ~*)
  311. +     if $test -f /bin/csh; then
  312. +     /bin/csh -f -c "glob \$1"
  313. +     echo ""
  314. +     else
  315. +     name=\`$expr x\$1 : '..\([^/]*\)'\`
  316. +     dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
  317. +     if $test ! -d "\$dir"; then
  318. +         me=\`basename \$0\`
  319. +         echo "\$me: can't locate home directory for: \$name" >&2
  320. +         exit 1
  321. +     fi
  322. +     case "\$1" in
  323. +     */*)
  324. +         echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
  325. +         ;;
  326. +     *)
  327. +         echo \$dir
  328. +         ;;
  329. +     esac
  330. +     fi
  331. +     ;;
  332. + *)
  333. +     echo \$1
  334. +     ;;
  335. + esac
  336. + EOSS
  337. + chmod +x filexp
  338. + $eunicefix filexp
  339.   # determine text processor to use, default to troff if found.
  340.   case "$roff" in
  341.   '')
  342. ***************
  343. *** 4003,4009 ****
  344.       if $test -n "$i_sysutime"; then
  345.           echo "Found <sys/utime.h>"
  346.           i_utime="$undef"
  347. !         i_sys/utime="$define"
  348.       else
  349.           echo "Did not find <utime.h> or <sys/utime.h>"
  350.           i_utime="$undef"
  351. --- 3969,3975 ----
  352.       if $test -n "$i_sysutime"; then
  353.           echo "Found <sys/utime.h>"
  354.           i_utime="$undef"
  355. !         i_sysutime="$define"
  356.       else
  357.           echo "Did not find <utime.h> or <sys/utime.h>"
  358.           i_utime="$undef"
  359. ***************
  360. *** 4162,4167 ****
  361. --- 4128,4166 ----
  362.   Log='$Log'
  363.   Header='$Header'
  364.   
  365. + : determine where public executables go
  366. + case "$bin" in
  367. + '')
  368. +     dflt=`loc . /bin /usr/local/bin /usr/lbin /usr/local /usr/bin`
  369. +     ;;
  370. + *)  dflt="$bin"
  371. +     ;;
  372. + esac
  373. + cont=true
  374. + while $test "$cont" ; do
  375. +     echo " "
  376. +     rp="Where do you want to put the public executables? [$dflt]"
  377. +     $echo $n "$rp $c"
  378. +     . myread
  379. +     bin="$ans"
  380. +     bin=`filexp $bin`
  381. +     if test -d $bin; then
  382. +     cont=''
  383. +     else
  384. +     case "$fastread" in
  385. +     yes) dflt=y;;
  386. +     *) dflt=n;;
  387. +     esac
  388. +     rp="Directory $bin doesn't exist.  Use that name anyway? [$dflt]"
  389. +     $echo $n "$rp $c"
  390. +     . myread
  391. +     dflt=''
  392. +     case "$ans" in
  393. +     y*) cont='';;
  394. +     esac
  395. +     fi
  396. + done
  397.   : see if there is a strftime
  398.   set strftime d_strftime
  399.   eval $inlibc
  400. ***************
  401. *** 4274,4280 ****
  402.       if $test -d "$lib"; then
  403.       cont=''
  404.       else
  405. !     dflt=n
  406.       rp="Directory $lib doesn't exist.  Use that name anyway? [$dflt]"
  407.       $echo $n "$rp $c"
  408.       . myread
  409. --- 4273,4282 ----
  410.       if $test -d "$lib"; then
  411.       cont=''
  412.       else
  413. !     case "$fastread" in
  414. !     yes)    dflt=y;;
  415. !     *)    dflt=n;;
  416. !     esac
  417.       rp="Directory $lib doesn't exist.  Use that name anyway? [$dflt]"
  418.       $echo $n "$rp $c"
  419.       . myread
  420. ***************
  421. *** 4617,4623 ****
  422.   fi
  423.   : figure out timezone handling
  424.   
  425. - # timezone handling part 1 of 4 - setup test files
  426.   cp ../lib/get_tz.c try.c 2>/dev/null \
  427.       || $echo "Oh no!  I cannot find the \"lib/get_tz.c\" file."
  428.   cat >defs.h <<EOF
  429. --- 4619,4624 ----
  430. ***************
  431. *** 4625,4721 ****
  432.   #$i_systime I_SYSTIME
  433.   #include <stdio.h>
  434.   #include <sys/types.h>
  435. - int get_tz_mins();
  436. - char *get_tz_name();
  437. - #ifdef TEST_FOR_TZMINS
  438. - #define TZNAME_USE_TZNAME
  439. - #ifdef tzname
  440. - # undef tzname
  441. - #endif
  442. - #define tzname tzfoo
  443. - char *tzfoo[] = { "FOO", "BAR" };
  444. - main() { printf("%d\n", get_tz_mins((struct tm *)0)); exit(0); }
  445. - #else
  446. - main() { printf("%s\n", get_tz_name((struct tm *)0)); exit(0); }
  447. - #endif
  448.   EOF
  449. - # timezone handling part 2 of 4 - timezone offsets configuration
  450.   $echo " "
  451. ! it_worked=0
  452.   if $test -f try.c ; then
  453. !     $echo "Trying to figure out how to get timezone offsets."
  454. !     dflt_handling=$tzmins_handling
  455. !     for tzmins_handling in DFLT TM_TZADJ TM_GMTOFF TZAZ_GLOBAL TZ_GLOBAL \
  456. !         FTIME TIMEOFDAY ERROR ; do
  457. !     case "$tzmins_handling" in
  458. !         DFLT)        tzmins_handling=$dflt_handling ;;
  459. !         ERROR)        tzmins_handling=$dflt_handling ; break ;;
  460. !         $dflt_handling)    tzmins_handling= ;;
  461. !     esac
  462. !     $test "$tzmins_handling" = "" && continue
  463. !     $echo "Trying -DTZMINS_USE_$tzmins_handling"
  464. !     $cc -DTZMINS_USE_$tzmins_handling -DTEST_FOR_TZMINS \
  465. !         $ccflags try.c -o try >/dev/null 2>&1 || continue
  466. !     ./try >try.out 2>&1 || continue
  467. !     $echo "Alright!  That seems to have worked."
  468. !     dflt=y
  469. !     rp="Are you `cat try.out` mins west of the prime meridian? [$dflt]"
  470. !     $echo $n "$rp $c"
  471. !     . myread
  472. !     case "$ans" in
  473. !         N*|n*)    $echo "OK...I'll keep trying." ;;
  474. !         *)    it_worked=1 ; break ;;
  475. !     esac
  476. !     done
  477. ! fi
  478. ! if $test $it_worked -ne 1 ; then
  479. !     $echo "I cannot figure out how to get timezone offsets."
  480. !     if $test "$tzmins_handling" != "" ; then
  481. !     $echo "You said \"$tzmins_handling\" worked last time so I'll use that."
  482. !     else
  483. !     $echo "You are going to have to manually set \"tzmins_handling\"."
  484. !     fi
  485. ! fi
  486. ! # timezone handling part 3 of 4 - timezone names configuration
  487. ! $echo " "
  488. ! it_worked=0
  489. ! if $test "$tzmins_handling" != "" -a -f try.c ; then
  490. !     $echo "Trying to figure out how to get timezone names."
  491. !     dflt_handling=$tzname_handling
  492.       for tzname_handling in DFLT TM_NAME TM_ZONE TZNAME TIMEZONE ERROR ; do
  493.       case "$tzname_handling" in
  494. !         DFLT)        tzname_handling=$dflt_handling ;;
  495. !         ERROR)        tzname_handling=$dflt_handling ; break ;;
  496. !         $dflt_handling)    tzname_handling= ;;
  497.       esac
  498. -     $test "$tzname_handling" = "" && continue
  499.       $echo "Trying -DTZNAME_USE_$tzname_handling"
  500. !     $cc -DTZMINS_USE_$tzmins_handling -DTZNAME_USE_$tzname_handling \
  501. !         $ccflags try.c -o try >/dev/null 2>&1 || continue
  502. !     ./try >try.out 2>&1 || continue
  503. !     $echo "Alright!  That seems to have worked."
  504. !     dflt=y
  505. !     rp="Is \"`cat try.out`\" your local timezone name? [$dflt]"
  506. !     $echo $n "$rp $c"
  507. !     . myread
  508. !     case "$ans" in
  509. !         N*|n*)    $echo "OK...I'll keep trying." ;;
  510. !         *)    it_worked=1 ; break ;;
  511. !     esac
  512.       done
  513.   fi
  514. ! if $test $it_worked -ne 1 ; then
  515.       $echo "I cannot figure out how to get timezone names."
  516. !     if $test "$tzname_handling" != "" ; then
  517.       $echo "You said \"$tzname_handling\" worked last time so I'll use that."
  518.       else
  519. !     $echo "You are going to have to manually set \"tzname_handling\"."
  520.       fi
  521.   fi
  522. - # timezone handling part 4 of 4 - cleanup
  523.   $rm -f defs.h try.c try.o try try.out
  524.   
  525.   
  526. --- 4626,4668 ----
  527.   #$i_systime I_SYSTIME
  528.   #include <stdio.h>
  529.   #include <sys/types.h>
  530.   EOF
  531.   $echo " "
  532. ! dflt_handling=$tzname_handling
  533. ! tzname_handling=
  534.   if $test -f try.c ; then
  535. !     $echo "Figuring out how to get timezone names."
  536.       for tzname_handling in DFLT TM_NAME TM_ZONE TZNAME TIMEZONE ERROR ; do
  537.       case "$tzname_handling" in
  538. !     DFLT)        $test "$dflt_handling" = "" && continue
  539. !             tzname_handling=$dflt_handling
  540. !             ;;
  541. !     ERROR)        tzname_handling=
  542. !             break
  543. !             ;;
  544. !     $dflt_handling)    : avoid doing default twice
  545. !             continue
  546. !             ;;
  547.       esac
  548.       $echo "Trying -DTZNAME_USE_$tzname_handling"
  549. !     $cc -D_CONFIGURE -DTZNAME_USE_$tzname_handling $ccflags \
  550. !         try.c -o try >/dev/null 2>&1
  551. !     if $test $? -eq 0 && ./try >try.out 2>&1 ; then
  552. !         $echo "Alright!  That seems to have worked."
  553. !         break
  554. !     fi
  555.       done
  556.   fi
  557. ! if $test "$tzname_handling" = "" ; then
  558.       $echo "I cannot figure out how to get timezone names."
  559. !     if $test "$dflt_handling" != "" ; then
  560. !     tzname_handling="$dflt_handling"
  561.       $echo "You said \"$tzname_handling\" worked last time so I'll use that."
  562.       else
  563. !     tzname_handling=UNKNOWN
  564. !     $echo "You will have to set \"tzname_handling\" manually."
  565.       fi
  566.   fi
  567.   $rm -f defs.h try.c try.o try try.out
  568.   
  569.   
  570. ***************
  571. *** 4982,4988 ****
  572.   shsharp='$shsharp'
  573.   sharpbang='$sharpbang'
  574.   tmpdir='$tmpdir'
  575. - tzmins_handling='$tzmins_handling'
  576.   tzname_handling='$tzname_handling'
  577.   use_pmake='$use_pmake'
  578.   xencf='$xencf'
  579. --- 4929,4934 ----
  580.  
  581. Index: Instruct
  582. *** ../elm2.4/Instruct    Sun Dec  6 22:44:43 1992
  583. --- Instruct    Thu Mar 10 12:20:28 1994
  584. ***************
  585. *** 1,7 ****
  586.                   Instructions
  587.                   ------------
  588.   
  589. !                 Last Update: $Date: 1992/12/07 03:44:37 $
  590.   
  591.   
  592.       This file contains instructions on how to create and install
  593. --- 1,7 ----
  594.                   Instructions
  595.                   ------------
  596.   
  597. !                 Last Update: $Date: 1994/03/10 17:20:23 $
  598.   
  599.   
  600.       This file contains instructions on how to create and install
  601. ***************
  602. *** 49,57 ****
  603.   that for the moment) you should now be able to list the directory "bin"
  604.   and find the following files:
  605.   
  606. !   answer        checkalias     filter         messages      printmail
  607. !   arepdaemon    elm            frm            newalias      readmsg
  608. !   autoreply     fastmail       listalias      newmail
  609.   
  610.   next, you can install all the software on your system by;
  611.   
  612. --- 49,57 ----
  613.   that for the moment) you should now be able to list the directory "bin"
  614.   and find the following files:
  615.   
  616. !     answer      elmalias    frm         newalias    prlong
  617. !     checkalias  fastmail    listalias   newmail     readmsg
  618. !     elm         filter      messages    printmail
  619.   
  620.   next, you can install all the software on your system by;
  621.   
  622.  
  623. Index: MANIFEST
  624. *** ../elm2.4/MANIFEST    Sun Sep 26 22:14:42 1993
  625. --- MANIFEST    Thu Mar 10 12:14:46 1994
  626. ***************
  627. *** 17,23 ****
  628.   doc/Ref.guide
  629.   doc/Users.guide
  630.   doc/answer.1
  631. - doc/autoreply.1
  632.   doc/chkalias.1
  633.   doc/elm-help.0
  634.   doc/elm-help.1
  635. --- 17,22 ----
  636. ***************
  637. *** 64,71 ****
  638.   hdrs/regexp.h
  639.   hdrs/s_aliases.h
  640.   hdrs/s_answer.h
  641. - hdrs/s_arepdaem.h
  642. - hdrs/s_autoreply.h
  643.   hdrs/s_elm.h
  644.   hdrs/s_elmalias.h
  645.   hdrs/s_elmrc.h
  646. --- 63,68 ----
  647. ***************
  648. *** 133,140 ****
  649.   lib/validname.c
  650.   nls/C/C/C/s_aliases.m
  651.   nls/C/C/C/s_answer.m
  652. - nls/C/C/C/s_arepdaem.m
  653. - nls/C/C/C/s_autoreply.m
  654.   nls/C/C/C/s_elm.m
  655.   nls/C/C/C/s_elmalias.m
  656.   nls/C/C/C/s_elmrc.m
  657. --- 130,135 ----
  658. ***************
  659. *** 220,227 ****
  660.   test/test.mail
  661.   utils/Makefile.SH
  662.   utils/answer.c
  663. - utils/arepdaem.c
  664. - utils/autoreply.c
  665.   utils/checkalias.SH
  666.   utils/elmalias.c
  667.   utils/fastmail.c
  668. --- 215,220 ----
  669.  
  670. Index: Overview
  671. *** ../elm2.4/Overview    Fri Jan 29 16:08:56 1993
  672. --- Overview    Thu Mar 10 12:18:49 1994
  673. ***************
  674. *** 19,29 ****
  675.   other UNIX Mail Transport Agent (according to what's on your system)
  676.   and is a full replacement of programs like "/bin/mail" and "mailx".
  677.   The system is more than just a single program, however, and includes
  678. ! programs like "frm" to list a 'table of contents' of your mail,
  679.   "printmail" to quickly paginate mail files (to allow 'clean'
  680. ! printouts), and "autoreply", a systemwide daemon that can autoanswer
  681. ! mail for people while they're on vacation without having multiple
  682. ! copies spawned on the system.
  683.   
  684.   2. What's New about Elm?
  685.   
  686. --- 19,27 ----
  687.   other UNIX Mail Transport Agent (according to what's on your system)
  688.   and is a full replacement of programs like "/bin/mail" and "mailx".
  689.   The system is more than just a single program, however, and includes
  690. ! programs like "frm" to list a 'table of contents' of your mail, and
  691.   "printmail" to quickly paginate mail files (to allow 'clean'
  692. ! printouts).
  693.   
  694.   2. What's New about Elm?
  695.   
  696.  
  697. Index: Patchlist
  698. *** ../elm2.4/Patchlist    Sun Sep 26 22:14:42 1993
  699. --- Patchlist    Tue Sep 20 14:01:14 1994
  700. ***************
  701. *** 1,4 ****
  702. --- 1,151 ----
  703.   =========================================================
  704. + Patch Set - Patches 24: Tue Sep 20 14:01:13 EDT 1994
  705. + Elm 2.4PL23 -> Elm 2.4PL24beta
  706. + Remove autoreply/arepdaem, its a security hole
  707. + From: Syd
  708. + Fix where buffer was not getting null terminated during its
  709. + construction, so the strcat failed (due to garbage data existing in the
  710. + array at malloc() time).
  711. + From: lm@yallara.cs.rmit.oz.au (Luke Mewburn)
  712. + Fix ANSI prototype stripping macro
  713. + From: "Tom Moore" <tmoore@fievel.DaytonOH.NCR.COM>
  714. + fixed ReadCh() to recover from EINTR and EAGAIN instead
  715. + of just returning an unexpected EOF.
  716. + From: Jukka Ukkonen <ukkonen@csc.fi>
  717. + Replaced the get_tz_mins() routine in lib/get_tz.c with a portable
  718. + version that requires no configuration.  Rewrote the test case in
  719. + lib/get_tz.c, and also wrote in support to simplify configuration
  720. + tests.  Dropped TZMINS_USE_XXXX configuration parameter.  Simplified
  721. + timezone determination in Configure.  The new get_tz_mins() introduces
  722. + two side effects.  First it steps on the static data returned by
  723. + localtime().  Second, it uses a routine in lib/date_util.c, which
  724. + requires debug initializations.  Rewrote get_arpa_date() to work around
  725. + the first issue.  Rather than doing the same for lib/strftime.c, just
  726. + removed the timezone stuff with a conditional compile.  Elm does not
  727. + use it.  Added debugging initializations to util/fastmail.c.
  728. + From: chip@chinacat.unicom.com (Chip Rosenthal)
  729. + I made the following changes to elm 2.4pl23 module pmalloc.c after testing on
  730. + a DEC Alpha running OSF1 v1.3.  The difficulty is that the Alpha hardware
  731. + requires certain alignment for some operations which was not supplied by
  732. + pmalloc (8 byte for addresses instead of 4 byte).  I made a simple minded
  733. + change to pmalloc.c to force alignment of the allocated data block to be
  734. + adequate on DEC Alpha OSF1.
  735. + From: jim@lime.rsmas.miami.edu (Jim Brown)
  736. + detect whether atol() is a macro
  737. + From: Mitch DSouza <m.dsouza@mrc-applied-psychology.cambridge.ac.uk>
  738. + Recognize the "#$HDR" magic cookie as the header to place in the
  739. + user's elmrc file rather than hardwiring a minimally helpful
  740. + string into the binary.
  741. + From: chip@chinacat.unicom.com (Chip Rosenthal)
  742. + Fix Elm looping if an EOF is received.
  743. + From: Gregory Neil Shapiro <gshapiro@WPI.EDU>
  744. + There is a bug in the alias-system of elm-2.4.23 that did not appear in
  745. + elm-2.4.21. When searching for a string in the alias-table with the '//'
  746. + command, elm sometimes gets a segmentation fault. With help of a debugger,
  747. + I found that the function shift_lower gets a NULL argument. A fix is
  748. + appended, but maybe the problem lies elsewhere.
  749. + From: Sjaak Schilperoort <J.W.Schilperoort@research.ptt.nl>
  750. + The latest Linux shared library (4.5.8) "catches" a double fclose()
  751. + by generating a SIGSEGV.  :-/
  752. + From: fin!chip@dg-rtp.dg.com (Chip Salzenberg)
  753. + Fix a line of debug output that is too long
  754. + From: "C.R. Ritson" <C.R.Ritson@newcastle.ac.uk>
  755. + Here are some more of fixes to correctly call fflush() and unlock() in sequence.
  756. + From: Jukka Ukkonen <ukkonen@csc.fi>
  757. + I had to put in some changes to builtin+ to allow it to display
  758. + 8-bit letters as they should when the message has been sent
  759. + through a real 8-bit channel like ESMTP with 8bit MIME Content-
  760. + Transfer-Encoding.
  761. + From: Jukka Ukkonen <ukkonen@csc.fi>
  762. + Tune the Ultrix fix for ispell
  763. + From: Bill Gianopoulos <wag@sccux1.msd.ray.com>
  764. + Solaris 2.3 can return EACCES or EEXIST for lockfile already existing.
  765. + From: xcea@uxa.ecn.bgu.edu (Chad Adams)
  766. + Below are the changes required to compile/link elm 2.4 pl23 under
  767. + QNX 4.2 with the Watcom 9.5 compiler (very picky).
  768. + From: "Brian Campbell" <brianc@quantum>
  769. + In utils/from.c there was a conditionalized declaration of
  770. + getpwuid() which was triggered by the environment being non-
  771. + POSIX instead of non-STDC.
  772. + From: Jukka Antero Ukkonen <ukkonen@csc.fi>
  773. + There was a typo in src/curses.c. An include read out like
  774. + "# include <vararg.h>" though the file name should have been
  775. + varargs.h.
  776. + From: Jukka Antero Ukkonen <ukkonen@csc.fi>
  777. + Just a minor fix to an impossible character comparison.
  778. + From: Jukka Ukkonen <ukkonen@csc.fi>
  779. + I found a few months old patch I have not sent you before (I guess).
  780. + It avoids unknowingly confusing some too rigidly and simple mindedly
  781. + coded mailers with weird settings like
  782. +     charset=us-ascii and textencoding=8bit
  783. + This patch will force 7bit encoding with charset=us-ascii.
  784. + E.g. older versions of pine will dump core on 8bit & us-ascii.
  785. + From: Jukka Ukkonen <ukkonen@csc.fi>
  786. + I had to add a region of conditional compilation around "defs.h"
  787. + to make Configure work correctly with the TZNAME_USE_xxxx stuff.
  788. + From: Jukka Ukkonen <ukkonen@csc.fi>
  789. + The "copy_message" function in src/fileio.c incorrectly computes the
  790. + size of the message.  The "bytes_seen" variable currently counts all
  791. + bytes in the message ***including the message header*** when it should
  792. + only be counting the bytes in the actual body of the message.
  793. + From: Thomas Dwyer III <tomiii@mtu.edu>
  794. + Extra } in edit_mailbox removed.
  795. + From: Jan.Djarv@sa.erisoft.se (Jan Djarv)
  796. + Add an fflush to detect over quota on file saves.
  797. + From: Larry Schwimmer <rosebud@cyclone.Stanford.EDU>
  798. + Block sigwinch when in the external pager.
  799. + From: jwa@yog-sothoth.dcrt.nih.gov (James W. Adams)
  800. + Work around null from names by looking to see whether the second or
  801. + third field is a valid month and using that to determine if there
  802. + is an address.
  803. + From: alex@samwise.dccs.upenn.edu (Alex Garthwaite)
  804. + Fix up Solaris and SVR4 timeout signal handling
  805. + From: Syd
  806. + Add extern declaration of strerror to avoid compiler warning.
  807. + From: Jan.Djarv@sa.erisoft.se (Jan Djarv)
  808. + Moved #defines for SETJMP & LONGJMP from src/editmsg.c to hdrs/defs.h and
  809. + used them instead of (set|long)jmp directly. This makes the usage consistent
  810. + and Solaris 2.3 behaves correctly w.r.t stop/continue.
  811. + From: Jan.Djarv@sa.erisoft.se (Jan Djarv)
  812. + =========================================================
  813.   Patch Set - Patches 23a through 23d: Sun Sep 19 19:48:31 EDT 1993
  814.   Elm 2.4PL22 -> Elm 2.4PL23
  815.   
  816.  
  817.  
  818. Index: config.h.SH
  819. *** ../elm2.4/config.h.SH    Sun Sep 26 22:14:42 1993
  820. --- config.h.SH    Mon May 30 12:55:57 1994
  821. ***************
  822. *** 583,597 ****
  823.    */
  824.   #define    SIGHAND_TYPE    $sigtype
  825.   
  826. - /* TZMINS_USE_xxxxxx:
  827. -  *    Specify how to get timezone offset.  Possible values are:
  828. -  *         TZMINS_USE_TM_TZADJ    use (struct tm *)->tm_tzadj
  829. -  *         TZMINS_USE_TM_GMTOFF    use (struct tm *)->tm_gmtoff
  830. -  *         TZMINS_USE_TZAZ_GLOBAL    use "timezone, altzone" externals
  831. -  *         TZMINS_USE_TZ_GLOBAL    use "timezone" external
  832. -  *         TZMINS_USE_FTIME    use ftime() function
  833. -  *         TZMINS_USE_TIMEOFDAY    use gettimeofday() function
  834. -  */
  835.   /* TZNAME_USE_xxxxxx:
  836.    *    Specify how to get timezone name.  Possible values are:
  837.    *         TZNAME_USE_TM_NAME    use (struct tm *)->tm_name
  838. --- 583,588 ----
  839. ***************
  840. *** 599,605 ****
  841.    *         TZNAME_USE_TZNAME    use "tzname[]" external
  842.    *         TZNAME_USE_TIMEZONE    use timezone() function
  843.    */
  844. - #define TZMINS_USE_$tzmins_handling
  845.   #define TZNAME_USE_$tzname_handling
  846.   
  847.   /* XENIX:
  848. --- 590,595 ----
  849.  
  850. Index: doc/Makefile.SH
  851. Prereq: 5.11
  852. *** ../elm2.4/doc/Makefile.SH    Sun Apr 11 22:12:07 1993
  853. --- doc/Makefile.SH    Thu Mar 10 12:20:29 1994
  854. ***************
  855. *** 16,28 ****
  856.   echo "Extracting doc/Makefile (with variable substitutions)"
  857.   cat >Makefile <<!GROK!THIS!
  858.   #
  859. ! # $Id: Makefile.SH,v 5.11 1993/04/12 02:12:07 syd Exp $
  860.   #
  861.   #  Makefile for the documentation of the ELM mail system
  862.   #
  863.   #         (C) Copyright 1988-1992, USENET Community Trust
  864.   #
  865.   #  $Log: Makefile.SH,v $
  866.   # Revision 5.11  1993/04/12  02:12:07  syd
  867.   # Added elmalias.1 man page.  Updated Users.guide to mention elmalias.
  868.   # From: chip@chinacat.unicom.com (Chip Rosenthal)
  869. --- 16,32 ----
  870.   echo "Extracting doc/Makefile (with variable substitutions)"
  871.   cat >Makefile <<!GROK!THIS!
  872.   #
  873. ! # $Id: Makefile.SH,v 5.12 1994/03/10 17:20:23 syd Exp $
  874.   #
  875.   #  Makefile for the documentation of the ELM mail system
  876.   #
  877.   #         (C) Copyright 1988-1992, USENET Community Trust
  878.   #
  879.   #  $Log: Makefile.SH,v $
  880. + # Revision 5.12  1994/03/10  17:20:23  syd
  881. + # Remove autoreply
  882. + # From: Syd
  883. + #
  884.   # Revision 5.11  1993/04/12  02:12:07  syd
  885.   # Added elmalias.1 man page.  Updated Users.guide to mention elmalias.
  886.   # From: chip@chinacat.unicom.com (Chip Rosenthal)
  887. ***************
  888. *** 106,112 ****
  889.   
  890.   # List of installed man pages (except for wnemail.1 - handled differently)
  891.   MAN_LIST    =    $(MAN)/answer$(MANEXT)        \
  892. -             $(MAN)/autoreply$(MANEXT)    \
  893.               $(MAN)/checkalias$(MANEXT)    \
  894.               $(MAN)/elm$(MANEXT)        \
  895.               $(MAN)/elmalias$(MANEXT)    \
  896. --- 110,115 ----
  897. ***************
  898. *** 122,128 ****
  899.   
  900.   # List of installed catman pages (except for wnemail.1 - handled differently)
  901.   CATMAN_LIST    =    $(CATMAN)/answer$(CATMANEXT)$(SUFFIX)    \
  902. -             $(CATMAN)/autoreply$(CATMANEXT)$(SUFFIX)    \
  903.               $(CATMAN)/checkalias$(CATMANEXT)$(SUFFIX)\
  904.               $(CATMAN)/elm$(CATMANEXT)$(SUFFIX)    \
  905.               $(CATMAN)/elmalias$(CATMANEXT)$(SUFFIX)\
  906. --- 125,130 ----
  907. ***************
  908. *** 138,144 ****
  909.   
  910.   # List of formatted pages for catman
  911.   FORMATTED_PAGES_LIST =    catman/answer$(CATMANEXT)$(SUFFIX)    \
  912. -             catman/autoreply$(CATMANEXT)$(SUFFIX)    \
  913.               catman/checkalias$(CATMANEXT)$(SUFFIX)\
  914.               catman/elm$(CATMANEXT)$(SUFFIX)    \
  915.               catman/elmalias$(CATMANEXT)$(SUFFIX)\
  916. --- 140,145 ----
  917. ***************
  918. *** 155,161 ****
  919.   # List of remotely installed man pages (except for wnemail.1 - handled
  920.   # differently)
  921.   REMOTE_MAN_LIST    =    $(REMOTE)$(MAN)/answer$(MANEXT)    \
  922. -             $(REMOTE)$(MAN)/autoreply$(MANEXT)    \
  923.               $(REMOTE)$(MAN)/checkalias$(MANEXT)    \
  924.               $(REMOTE)$(MAN)/elm$(MANEXT)        \
  925.               $(REMOTE)$(MAN)/elmalias$(MANEXT)    \
  926. --- 156,161 ----
  927. ***************
  928. *** 253,262 ****
  929.                   $(CP) $? $@
  930.                   $(CHMOD) u=rw,go=r $@
  931.   
  932. - $(MAN)/autoreply$(MANEXT):    autoreply.1
  933. -                 $(CP) $? $@
  934. -                 $(CHMOD) u=rw,go=r $@
  935.   $(MAN)/checkalias$(MANEXT):    chkalias.1
  936.                   $(CP) $? $@
  937.                   $(CHMOD) u=rw,go=r $@
  938. --- 253,258 ----
  939. ***************
  940. *** 335,344 ****
  941.                   $(CP) $? $@
  942.                   $(CHMOD) u=rw,go=r $@
  943.   
  944. - $(CATMAN)/autoreply$(CATMANEXT)$(SUFFIX): catman/autoreply$(CATMANEXT)$(SUFFIX)
  945. -                 $(CP) $? $@
  946. -                 $(CHMOD) u=rw,go=r $@
  947.   $(CATMAN)/checkalias$(CATMANEXT)$(SUFFIX): catman/checkalias$(CATMANEXT)$(SUFFIX)
  948.                   $(CP) $? $@
  949.                   $(CHMOD) u=rw,go=r $@
  950. --- 331,336 ----
  951. ***************
  952. *** 399,413 ****
  953.       @if $(TEST) "$(PACKED)" = y ; then \
  954.           $(RM) $@ ; \
  955.           $(PACKER) catman/answer$(CATMANEXT) ; \
  956. -     else \
  957. -         true ; \
  958. -     fi
  959. - catman/autoreply$(CATMANEXT)$(SUFFIX):        autoreply.1
  960. -     $(MANROFF) $(MANROFF_OPTS) -man $? > catman/autoreply$(CATMANEXT)
  961. -     @if $(TEST) "$(PACKED)" = y ; then \
  962. -         $(RM) $@ ; \
  963. -         $(PACKER) catman/autoreply$(CATMANEXT) ; \
  964.       else \
  965.           true ; \
  966.       fi
  967. --- 391,396 ----
  968.  
  969. Index: doc/Users.guide
  970. Prereq: 5.8
  971. *** ../elm2.4/doc/Users.guide    Sat May  8 16:19:23 1993
  972. --- doc/Users.guide    Thu Mar 10 12:21:24 1994
  973. ***************
  974. *** 1,4 ****
  975. ! .\" @(#)$Id: Users.guide,v 5.8 1993/05/08 20:00:22 syd Exp $
  976.   .\"
  977.   .\"  Users guide to the ELM mail system.
  978.   .\"  format with:
  979. --- 1,4 ----
  980. ! .\" @(#)$Id: Users.guide,v 5.9 1994/03/10 17:21:21 syd Exp $
  981.   .\"
  982.   .\"  Users guide to the ELM mail system.
  983.   .\"  format with:
  984. ***************
  985. *** 12,17 ****
  986. --- 12,20 ----
  987.   .\"  (C) Copyright 1988-1992 Usenet Community Trust
  988.   .\"
  989.   .\"  $Log: Users.guide,v $
  990. + .\" Revision 5.9  1994/03/10  17:21:21  syd
  991. + .\" remove autoreply
  992. + .\"
  993.   .\" Revision 5.8  1993/05/08  20:00:22  syd
  994.   .\" fix mail added >From lines
  995.   .\" From: Syd
  996. ***************
  997. *** 875,885 ****
  998.   .lp \h'10p'answer 1.0i
  999.   An answering-machine transcription program.  Please see the
  1000.   manual entry for more information on how to use this program.
  1001. - .lp \h'10p'autoreply 1.0i
  1002. - This program, in conjunction with the \f2arepdaemon\f1, enables users
  1003. - to automatically reply to incoming mail when they're not directly
  1004. - available.
  1005.   
  1006.   .lp \h'10p'checkalias 1.0i
  1007.   A script for checking aliases simply.
  1008. --- 878,883 ----
  1009.  
  1010. Index: doc/elmrc-info
  1011. Prereq: 5.10
  1012. *** ../elm2.4/doc/elmrc-info    Sun Sep 26 22:14:44 1993
  1013. --- doc/elmrc-info    Fri Mar 11 16:19:26 1994
  1014. ***************
  1015. *** 1,6 ****
  1016. ! #@(#)$Id: elmrc-info,v 5.10 1993/08/23 02:53:52 syd Exp $
  1017.   # Elm Version 2.4
  1018. ! # For yes/no settings with ?, ON means yes, OFF means no
  1019.   
  1020.   shell
  1021.   # The shell to use for shell escapes
  1022. --- 1,17 ----
  1023. ! #@(#)$Id: elmrc-info,v 5.11 1994/03/11 21:19:26 syd Exp $
  1024.   # Elm Version 2.4
  1025. ! #
  1026. ! #$HDR - magic line to mark comments to put at top of user's elmrc file.
  1027. ! #
  1028. ! # For yes/no settings, ON means yes, OFF means no.
  1029. ! #
  1030. ! # Lines beginning with "#" (like this one!) are comments.
  1031. ! #
  1032. ! # The "###" lines mean that you do not have a value set and the system
  1033. ! # default will be used.  The value shown was the default at the time
  1034. ! # this file was created.  Yes...the default could have changed between
  1035. ! # then and now.
  1036. ! #
  1037.   
  1038.   shell
  1039.   # The shell to use for shell escapes
  1040.  
  1041. Index: filter/filter.c
  1042. Prereq: 5.6
  1043. *** ../elm2.4/filter/filter.c    Sun Sep 26 22:14:44 1993
  1044. --- filter/filter.c    Mon May 30 12:31:55 1994
  1045. ***************
  1046. *** 1,8 ****
  1047.   
  1048. ! static char rcsid[] ="@(#)$Id: filter.c,v 5.6 1993/08/03 19:28:39 syd Exp $";
  1049.   
  1050.   /*******************************************************************************
  1051. !  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
  1052.    *
  1053.    *             Copyright (c) 1988-1992 USENET Community Trust
  1054.    *             Copyright (c) 1986,1987 Dave Taylor
  1055. --- 1,8 ----
  1056.   
  1057. ! static char rcsid[] ="@(#)$Id: filter.c,v 5.7 1994/05/30 16:31:40 syd Exp $";
  1058.   
  1059.   /*******************************************************************************
  1060. !  *  The Elm Mail System  -  $Revision: 5.7 $   $State: Exp $
  1061.    *
  1062.    *             Copyright (c) 1988-1992 USENET Community Trust
  1063.    *             Copyright (c) 1986,1987 Dave Taylor
  1064. ***************
  1065. *** 14,19 ****
  1066. --- 14,23 ----
  1067.    *
  1068.    *******************************************************************************
  1069.    * $Log: filter.c,v $
  1070. +  * Revision 5.7  1994/05/30  16:31:40  syd
  1071. +  * make getpwuid dependent on ANSI_C not posix flag
  1072. +  * From: Syd
  1073. +  *
  1074.    * Revision 5.6  1993/08/03  19:28:39  syd
  1075.    * Elm tries to replace the system toupper() and tolower() on current
  1076.    * BSD systems, which is unnecessary.  Even worse, the replacements
  1077. ***************
  1078. *** 98,104 ****
  1079.       extern char *optarg;
  1080.       FILE   *fd;                /* for output to temp file! */
  1081.       struct passwd  *passwd_entry;
  1082. ! #ifndef    _POSIX_SOURCE
  1083.       struct passwd  *getpwuid();        /* for /etc/passwd          */
  1084.   #endif
  1085.       char filename[SLEN],            /* name of the temp file    */
  1086. --- 102,108 ----
  1087.       extern char *optarg;
  1088.       FILE   *fd;                /* for output to temp file! */
  1089.       struct passwd  *passwd_entry;
  1090. ! #ifndef    ANSI_C
  1091.       struct passwd  *getpwuid();        /* for /etc/passwd          */
  1092.   #endif
  1093.       char filename[SLEN],            /* name of the temp file    */
  1094.  
  1095. Index: filter/rules.c
  1096. Prereq: 5.8
  1097. *** ../elm2.4/filter/rules.c    Sun Sep 26 22:15:11 1993
  1098. --- filter/rules.c    Fri Mar 11 15:40:24 1994
  1099. ***************
  1100. *** 1,8 ****
  1101.   
  1102. ! static char rcsid[] ="@(#)$Id: rules.c,v 5.8 1993/08/03 19:28:39 syd Exp $";
  1103.   
  1104.   /*******************************************************************************
  1105. !  *  The Elm Mail System  -  $Revision: 5.8 $   $State: Exp $
  1106.    *
  1107.    *             Copyright (c) 1988-1992 USENET Community Trust
  1108.    *             Copyright (c) 1986,1987 Dave Taylor
  1109. --- 1,8 ----
  1110.   
  1111. ! static char rcsid[] ="@(#)$Id: rules.c,v 5.9 1994/03/11 20:40:24 syd Exp $";
  1112.   
  1113.   /*******************************************************************************
  1114. !  *  The Elm Mail System  -  $Revision: 5.9 $   $State: Exp $
  1115.    *
  1116.    *             Copyright (c) 1988-1992 USENET Community Trust
  1117.    *             Copyright (c) 1986,1987 Dave Taylor
  1118. ***************
  1119. *** 14,19 ****
  1120. --- 14,25 ----
  1121.    *
  1122.    *******************************************************************************
  1123.    * $Log: rules.c,v $
  1124. +  * Revision 5.9  1994/03/11  20:40:24  syd
  1125. +  * Fix where buffer was not getting null terminated during its
  1126. +  * construction, so the strcat failed (due to garbage data existing in the
  1127. +  * array at malloc() time).
  1128. +  * From: lm@yallara.cs.rmit.oz.au (Luke Mewburn)
  1129. +  *
  1130.    * Revision 5.8  1993/08/03  19:28:39  syd
  1131.    * Elm tries to replace the system toupper() and tolower() on current
  1132.    * BSD systems, which is unnecessary.  Even worse, the replacements
  1133. ***************
  1134. *** 359,365 ****
  1135.                else regsub = word[i] - '0';
  1136.   
  1137.                if (display) {
  1138. !                strcat(buffer,catgets(elm_msg_cat,
  1139.                            FilterSet,
  1140.                            regmessage[regsub].id,
  1141.                            regmessage[regsub].str));
  1142. --- 365,371 ----
  1143.                else regsub = word[i] - '0';
  1144.   
  1145.                if (display) {
  1146. !                strcpy(buffer + j,catgets(elm_msg_cat,
  1147.                            FilterSet,
  1148.                            regmessage[regsub].id,
  1149.                            regmessage[regsub].str));
  1150.  
  1151. Index: hdrs/defs.h
  1152. Prereq: 5.33
  1153. *** ../elm2.4/hdrs/defs.h    Sun Sep 26 22:14:45 1993
  1154. --- hdrs/defs.h    Thu Sep  1 15:42:39 1994
  1155. ***************
  1156. *** 1,8 ****
  1157.   
  1158. ! /* $Id: defs.h,v 5.33 1993/09/19 23:40:48 syd Exp $ */
  1159.   
  1160.   /*******************************************************************************
  1161. !  *  The Elm Mail System  -  $Revision: 5.33 $   $State: Exp $
  1162.    *
  1163.    *             Copyright (c) 1988-1992 USENET Community Trust
  1164.    *             Copyright (c) 1986,1987 Dave Taylor
  1165. --- 1,8 ----
  1166.   
  1167. ! /* $Id: defs.h,v 5.35 1994/09/01 19:42:39 syd Exp $ */
  1168.   
  1169.   /*******************************************************************************
  1170. !  *  The Elm Mail System  -  $Revision: 5.35 $   $State: Exp $
  1171.    *
  1172.    *             Copyright (c) 1988-1992 USENET Community Trust
  1173.    *             Copyright (c) 1986,1987 Dave Taylor
  1174. ***************
  1175. *** 14,19 ****
  1176. --- 14,30 ----
  1177.    *
  1178.    *******************************************************************************
  1179.    * $Log: defs.h,v $
  1180. +  * Revision 5.35  1994/09/01  19:42:39  syd
  1181. +  * Moved #defines for SETJMP & LONGJMP from src/editmsg.c to hdrs/defs.h and
  1182. +  * used them instead of (set|long)jmp directly. This makes the usage consistent
  1183. +  * and Solaris 2.3 behaves correctly w.r.t stop/continue.
  1184. +  * From: Jan.Djarv@sa.erisoft.se (Jan Djarv)
  1185. +  *
  1186. +  * Revision 5.34  1994/05/15  23:10:08  syd
  1187. +  * Below are the changes required to compile/link elm 2.4 pl23 under
  1188. +  * QNX 4.2 with the Watcom 9.5 compiler (very picky).
  1189. +  * From: "Brian Campbell" <brianc@quantum>
  1190. +  *
  1191.    * Revision 5.33  1993/09/19  23:40:48  syd
  1192.    * Defince SEEK_SET in one of our headers as a last resort
  1193.    * From: Syd
  1194. ***************
  1195. *** 649,654 ****
  1196. --- 660,667 ----
  1197.   #define MCprintf printf
  1198.   #define MCfprintf fprintf
  1199.   #define MCsprintf sprintf
  1200. + #else
  1201. + #include "mcprt.h"
  1202.   #endif
  1203.   
  1204.   #ifdef POSIX_SIGNALS
  1205. ***************
  1206. *** 666,671 ****
  1207. --- 679,694 ----
  1208.   #endif
  1209.   #endif /* SIGSET */
  1210.   #endif /* POSIX_SIGNALS */
  1211. + #if defined(POSIX_SIGNALS) && !defined(__386BSD__)
  1212. + # define JMP_BUF        sigjmp_buf
  1213. + # define SETJMP(env)        sigsetjmp((env), 1)
  1214. + # define LONGJMP(env,val)    siglongjmp((env), (val))
  1215. + #else
  1216. + # define JMP_BUF        jmp_buf
  1217. + # define SETJMP(env)        setjmp(env)
  1218. + # define LONGJMP(env,val)    longjmp((env), (val))
  1219. + #endif
  1220.   
  1221.   /*
  1222.    * Some of the old BSD ctype conversion macros corrupted characters.
  1223.  
  1224. Index: hdrs/elm.h
  1225. Prereq: 5.10
  1226. *** ../elm2.4/hdrs/elm.h    Sun Sep 26 22:14:45 1993
  1227. --- hdrs/elm.h    Thu Sep  1 15:42:40 1994
  1228. ***************
  1229. *** 1,8 ****
  1230.   
  1231. ! /* $Id: elm.h,v 5.10 1993/08/10 18:49:32 syd Exp $ */
  1232.   
  1233.   /*******************************************************************************
  1234. !  *  The Elm Mail System  -  $Revision: 5.10 $   $State: Exp $
  1235.    *
  1236.    *             Copyright (c) 1988-1992 USENET Community Trust
  1237.    *             Copyright (c) 1986,1987 Dave Taylor
  1238. --- 1,8 ----
  1239.   
  1240. ! /* $Id: elm.h,v 5.12 1994/09/01 19:42:39 syd Exp $ */
  1241.   
  1242.   /*******************************************************************************
  1243. !  *  The Elm Mail System  -  $Revision: 5.12 $   $State: Exp $
  1244.    *
  1245.    *             Copyright (c) 1988-1992 USENET Community Trust
  1246.    *             Copyright (c) 1986,1987 Dave Taylor
  1247. ***************
  1248. *** 14,19 ****
  1249. --- 14,29 ----
  1250.    *
  1251.    *******************************************************************************
  1252.    * $Log: elm.h,v $
  1253. +  * Revision 5.12  1994/09/01  19:42:39  syd
  1254. +  * Moved #defines for SETJMP & LONGJMP from src/editmsg.c to hdrs/defs.h and
  1255. +  * used them instead of (set|long)jmp directly. This makes the usage consistent
  1256. +  * and Solaris 2.3 behaves correctly w.r.t stop/continue.
  1257. +  * From: Jan.Djarv@sa.erisoft.se (Jan Djarv)
  1258. +  *
  1259. +  * Revision 5.11  1994/08/30  18:16:05  syd
  1260. +  * Fix up Solaris and SVR4 signal handling for timeout
  1261. +  * From: Syd
  1262. +  *
  1263.    * Revision 5.10  1993/08/10  18:49:32  syd
  1264.    * When an environment variable was given as the tmpdir definition the src
  1265.    * and dest overlapped in expand_env.  This made elm produce a garbage
  1266. ***************
  1267. *** 81,90 ****
  1268.   
  1269.   #include "../hdrs/curses.h"
  1270.   #include "../hdrs/defs.h"
  1271. - #ifdef    BSD
  1272.   #include <setjmp.h>
  1273. - #endif
  1274.   
  1275.   /******** static character string containing the version number  *******/
  1276.   
  1277. --- 91,97 ----
  1278. ***************
  1279. *** 283,289 ****
  1280.   int mailgroupid;        /* groupid for current user   */
  1281.   #endif
  1282.   
  1283. ! #ifdef    BSD
  1284. ! jmp_buf GetPromptBuf;        /* setjmp buffer */
  1285.   int InGetPrompt;        /* set if in GetPrompt() in read() */
  1286. - #endif
  1287. --- 290,294 ----
  1288.   int mailgroupid;        /* groupid for current user   */
  1289.   #endif
  1290.   
  1291. ! JMP_BUF GetPromptBuf;        /* setjmp buffer */
  1292.   int InGetPrompt;        /* set if in GetPrompt() in read() */
  1293.  
  1294. Index: hdrs/headers.h
  1295. Prereq: 5.11
  1296. *** ../elm2.4/hdrs/headers.h    Sun Sep 26 22:14:45 1993
  1297. --- hdrs/headers.h    Thu Sep  1 15:42:40 1994
  1298. ***************
  1299. *** 1,8 ****
  1300.   
  1301. ! /* $Id: headers.h,v 5.11 1993/08/10 20:49:40 syd Exp $ */
  1302.   
  1303.   /*******************************************************************************
  1304. !  *  The Elm Mail System  -  $Revision: 5.11 $   $State: Exp $
  1305.    *
  1306.    *             Copyright (c) 1988-1992 USENET Community Trust
  1307.    *             Copyright (c) 1986,1987 Dave Taylor
  1308. --- 1,8 ----
  1309.   
  1310. ! /* $Id: headers.h,v 5.13 1994/09/01 19:42:39 syd Exp $ */
  1311.   
  1312.   /*******************************************************************************
  1313. !  *  The Elm Mail System  -  $Revision: 5.13 $   $State: Exp $
  1314.    *
  1315.    *             Copyright (c) 1988-1992 USENET Community Trust
  1316.    *             Copyright (c) 1986,1987 Dave Taylor
  1317. ***************
  1318. *** 14,19 ****
  1319. --- 14,29 ----
  1320.    *
  1321.    *******************************************************************************
  1322.    * $Log: headers.h,v $
  1323. +  * Revision 5.13  1994/09/01  19:42:39  syd
  1324. +  * Moved #defines for SETJMP & LONGJMP from src/editmsg.c to hdrs/defs.h and
  1325. +  * used them instead of (set|long)jmp directly. This makes the usage consistent
  1326. +  * and Solaris 2.3 behaves correctly w.r.t stop/continue.
  1327. +  * From: Jan.Djarv@sa.erisoft.se (Jan Djarv)
  1328. +  *
  1329. +  * Revision 5.12  1994/08/30  18:16:05  syd
  1330. +  * Fix up Solaris and SVR4 signal handling for timeout
  1331. +  * From: Syd
  1332. +  *
  1333.    * Revision 5.11  1993/08/10  20:49:40  syd
  1334.    * Add raw_temp_dir
  1335.    *
  1336. ***************
  1337. *** 81,90 ****
  1338.   
  1339.   #include "curses.h"
  1340.   #include "defs.h"
  1341. - #ifdef    BSD
  1342.   #include <setjmp.h>
  1343. - #endif
  1344.   
  1345.   #ifdef MIME
  1346.   #include "mime.h"
  1347. --- 91,97 ----
  1348. ***************
  1349. *** 274,280 ****
  1350.   extern int mailgroupid;        /* groupid for current user   */
  1351.   #endif
  1352.   
  1353. ! #ifdef    BSD
  1354. ! extern jmp_buf GetPromptBuf;    /* setjmp buffer */
  1355.   extern int InGetPrompt;        /* set if in GetPrompt() in read() */
  1356. - #endif
  1357. --- 281,285 ----
  1358.   extern int mailgroupid;        /* groupid for current user   */
  1359.   #endif
  1360.   
  1361. ! extern JMP_BUF GetPromptBuf;    /* setjmp buffer */
  1362.   extern int InGetPrompt;        /* set if in GetPrompt() in read() */
  1363.  
  1364. Index: hdrs/mcprt.h
  1365. *** ../elm2.4/hdrs/mcprt.h    Sun Sep 26 22:14:46 1993
  1366. --- hdrs/mcprt.h    Thu Jun 30 12:42:29 1994
  1367. ***************
  1368. *** 48,54 ****
  1369.   #include <stdio.h>
  1370.   
  1371.   #ifdef USENLS
  1372. ! #  ifdef I_STDARG
  1373.   extern int         MCprintf(char *fmt, ...);
  1374.   extern int         MCfprintf(FILE *fptr, char *fmt, ...);
  1375.   extern int         MCsprintf(char *cptr, char *fmt, ...);
  1376. --- 48,54 ----
  1377.   #include <stdio.h>
  1378.   
  1379.   #ifdef USENLS
  1380. ! #  ifdef ANSI_C
  1381.   extern int         MCprintf(char *fmt, ...);
  1382.   extern int         MCfprintf(FILE *fptr, char *fmt, ...);
  1383.   extern int         MCsprintf(char *cptr, char *fmt, ...);
  1384.  
  1385. Index: hdrs/s_elmrc.h
  1386. *** ../elm2.4/hdrs/s_elmrc.h    Sat Oct  3 18:35:12 1992
  1387. --- hdrs/s_elmrc.h    Fri Mar 11 16:18:49 1994
  1388. ***************
  1389. *** 1,4 ****
  1390. ! /* s_elmrc.h created from s_elmrc.us by gencat on Sat Oct  3 18:34:09 EDT 1992 */
  1391.   
  1392.   #define ElmrcSet    0x1
  1393.   #define ElmrcExpandHome    0x1
  1394. --- 1,4 ----
  1395. ! /* s_elmrc.h created from s_elmrc.us by gencat on Fri Mar 11 16:18:48 EST 1994 */
  1396.   
  1397.   #define ElmrcSet    0x1
  1398.   #define ElmrcExpandHome    0x1
  1399. ***************
  1400. *** 10,13 ****
  1401.   #define ElmrcOptionsFile    0x7
  1402.   #define ElmrcSavedAutoFor    0x8
  1403.   #define ElmrcSavedAuto    0x9
  1404. - #define ElmrcYesNoMeans    0xa
  1405. --- 10,12 ----
  1406.  
  1407. Index: lib/errno.c
  1408. Prereq: 5.3
  1409. *** ../elm2.4/lib/errno.c    Tue Apr 20 21:58:28 1993
  1410. --- lib/errno.c    Thu Sep  1 15:42:07 1994
  1411. ***************
  1412. *** 1,8 ****
  1413.   
  1414. ! static char rcsid[] = "@(#)$Id: errno.c,v 5.3 1993/04/21 01:58:20 syd Exp $";
  1415.   
  1416.   /*******************************************************************************
  1417. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  1418.    *
  1419.    *            Copyright (c) 1988-1992 USENET Community Trust
  1420.    *            Copyright (c) 1986,1987 Dave Taylor
  1421. --- 1,8 ----
  1422.   
  1423. ! static char rcsid[] = "@(#)$Id: errno.c,v 5.4 1994/09/01 19:42:07 syd Exp $";
  1424.   
  1425.   /*******************************************************************************
  1426. !  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
  1427.    *
  1428.    *            Copyright (c) 1988-1992 USENET Community Trust
  1429.    *            Copyright (c) 1986,1987 Dave Taylor
  1430. ***************
  1431. *** 14,19 ****
  1432. --- 14,23 ----
  1433.    *
  1434.    *******************************************************************************
  1435.    * $Log: errno.c,v $
  1436. +  * Revision 5.4  1994/09/01  19:42:07  syd
  1437. +  * Add extern declaration of strerror to avoid compiler warning.
  1438. +  * From: Jan.Djarv@sa.erisoft.se (Jan Djarv)
  1439. +  *
  1440.    * Revision 5.3  1993/04/21  01:58:20  syd
  1441.    * change to detect strerror routine
  1442.    * From: Syd
  1443. ***************
  1444. *** 91,96 ****
  1445. --- 95,102 ----
  1446.   int errnumber;
  1447.   {
  1448.   #ifdef STRERROR
  1449. +     extern char *strerror();
  1450.   
  1451.       return strerror(errnumber);
  1452.   
  1453.  
  1454. Index: lib/get_tz.c
  1455. Prereq: 5.1
  1456. *** ../elm2.4/lib/get_tz.c    Sun Sep 26 22:14:49 1993
  1457. --- lib/get_tz.c    Mon May 30 12:53:43 1994
  1458. ***************
  1459. *** 1,8 ****
  1460.   
  1461. ! static char rcsid[] = "@(#)$Id: get_tz.c,v 5.1 1993/08/10 18:56:53 syd Exp $";
  1462.   
  1463.   /*******************************************************************************
  1464. !  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
  1465.    *
  1466.    *             Copyright (c) 1992, 1993 USENET Community Trust
  1467.    *******************************************************************************
  1468. --- 1,8 ----
  1469.   
  1470. ! static char rcsid[] = "@(#)$Id: get_tz.c,v 5.4 1994/05/30 16:53:35 syd Exp $";
  1471.   
  1472.   /*******************************************************************************
  1473. !  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
  1474.    *
  1475.    *             Copyright (c) 1992, 1993 USENET Community Trust
  1476.    *******************************************************************************
  1477. ***************
  1478. *** 13,71 ****
  1479.    *
  1480.    *******************************************************************************
  1481.    * $Log: get_tz.c,v $
  1482.    * Revision 5.1  1993/08/10  18:56:53  syd
  1483.    * Initial Checkin
  1484.    *
  1485.    *
  1486.    ******************************************************************************/
  1487.   
  1488. - /*
  1489. -  * get_tz - Site-specific timezone handling.
  1490. -  *
  1491. -  * get_tz_mins(tm) - Return timezone adjustment in minutes west of GMT.
  1492. -  * get_tz_name(tm) - Return timezone name.
  1493. -  *
  1494. -  * These procedures return timezone infomation for the time specified by "tm".
  1495. -  * If "tm" is NULL, then the local, current timezone info are returned.
  1496. -  *
  1497. -  * On some systems, regardless of the "tm" value, the local timezone
  1498. -  * values are returned.
  1499. -  *
  1500. -  * On some systems, when passing a non-NULL "tm" value, a call to "tzset()"
  1501. -  * must be performed prior to invoking these routines to obtain proper
  1502. -  * timezone information.  Note that some systems will implicitly call
  1503. -  * "tzset()" through other routines, such as "localtime()".  On such
  1504. -  * systems an explicit "tzset()" is not required if the "tm" value was
  1505. -  * obtained through a routine that does the implicit setup.
  1506. -  *
  1507. -  * The task of discovering timezone info is a horrid mess because so many
  1508. -  * systems have different notions about how to do it.  The goal of these
  1509. -  * routines is to encapsulate the system dependancies here.  Two definitions,
  1510. -  * TZMINS_USE_xxxxxx and TZNAME_USE_xxxxxx must be enabled as appropriate
  1511. -  * for this system.  Exactly _one_ definition from each group must be
  1512. -  * specified.  The available choices are:
  1513. -  *
  1514. -  * TZMINS_USE_xxxxxx specifies how to get timezone offset.
  1515. -  *
  1516. -  *    TZMINS_USE_TM_TZADJ    use (struct tm*)->tm_tzadj
  1517. -  *    TZMINS_USE_TM_GMTOFF   use (struct tm*)->tm_gmtoff
  1518. -  *    TZMINS_USE_TZAZ_GLOBAL use "timezone, altzone" externals
  1519. -  *    TZMINS_USE_TZ_GLOBAL   use "timezone" external
  1520. -  *    TZMINS_USE_FTIME       use ftime() function
  1521. -  *    TZMINS_USE_TIMEOFDAY   use gettimeofday() function
  1522. -  *
  1523. -  * TZNAME_USE_xxxxxx specifies how to get timezone name.
  1524. -  *
  1525. -  *    TZNAME_USE_TM_NAME     use (struct tm *)->tm_name
  1526. -  *    TZNAME_USE_TM_ZONE     use (struct tm *)->tm_zone
  1527. -  *    TZNAME_USE_TZNAME      use "tzname[]" external
  1528. -  *    TZNAME_USE_TIMEZONE    use timezone() function
  1529. -  *
  1530. -  * The TZMINS_HANDLING and TZNAME_HANDLING definitions are just used
  1531. -  * to verify the configurations were setup correctly.  They force
  1532. -  * compiler warnings and/or errors in the event of a configuration problem.
  1533. -  */
  1534.   #include "defs.h"
  1535.   
  1536.   #ifdef I_TIME
  1537. --- 13,46 ----
  1538.    *
  1539.    *******************************************************************************
  1540.    * $Log: get_tz.c,v $
  1541. +  * Revision 5.4  1994/05/30  16:53:35  syd
  1542. +  * back out revision, uses local defs.h
  1543. +  *
  1544. +  * Revision 5.3  1994/05/30  16:46:07  syd
  1545. +  * I had to add a region of conditional compilation around "defs.h"
  1546. +  * to make Configure work correctly with the TZNAME_USE_xxxx stuff.
  1547. +  * From: Jukka Ukkonen <ukkonen@csc.fi>
  1548. +  *
  1549. +  * Revision 5.2  1994/03/11  20:55:23  syd
  1550. +  * Replaced the get_tz_mins() routine in lib/get_tz.c with a portable
  1551. +  * version that requires no configuration.  Rewrote the test case in
  1552. +  * lib/get_tz.c, and also wrote in support to simplify configuration
  1553. +  * tests.  Dropped TZMINS_USE_XXXX configuration parameter.  Simplified
  1554. +  * timezone determination in Configure.  The new get_tz_mins() introduces
  1555. +  * two side effects.  First it steps on the static data returned by
  1556. +  * localtime().  Second, it uses a routine in lib/date_util.c, which
  1557. +  * requires debug initializations.  Rewrote get_arpa_date() to work around
  1558. +  * the first issue.  Rather than doing the same for lib/strftime.c, just
  1559. +  * removed the timezone stuff with a conditional compile.  Elm does not
  1560. +  * use it.  Added debugging initializations to util/fastmail.c.
  1561. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  1562. +  *
  1563.    * Revision 5.1  1993/08/10  18:56:53  syd
  1564.    * Initial Checkin
  1565.    *
  1566.    *
  1567.    ******************************************************************************/
  1568.   
  1569.   #include "defs.h"
  1570.   
  1571.   #ifdef I_TIME
  1572. ***************
  1573. *** 74,204 ****
  1574.   #ifdef I_SYSTIME
  1575.   #  include <sys/time.h>
  1576.   #endif
  1577. - #ifdef TZMINS_USE_FTIME
  1578. - #  include <sys/timeb.h>
  1579. - #endif
  1580.   
  1581.   #ifndef    _POSIX_SOURCE
  1582.   extern struct tm *localtime();
  1583.   extern time_t      time();
  1584.   #endif
  1585.   
  1586. - /****************************************************************************/
  1587.   
  1588. ! int get_tz_mins(tm)
  1589. ! struct tm *tm;
  1590.   {
  1591. !     if (tm == 0) {
  1592. !         time_t t;
  1593. !         (void) time(&t);
  1594. !         tm = localtime(&t);
  1595. !     }
  1596. ! #ifdef TZMINS_USE_TM_TZADJ
  1597. ! #define TZMINS_HANDLING 1
  1598. !     /*
  1599. !      * This system maintains the timezone offset in the (struct tm)
  1600. !      * as a number of _seconds_ west of GMT.
  1601. !      */
  1602. !     return (int)(tm->tm_tzadj / 60);
  1603.   #endif
  1604.   
  1605. - #ifdef TZMINS_USE_TM_GMTOFF
  1606. - #define TZMINS_HANDLING 2
  1607. -     /*
  1608. -      * This system maintains the timezone offset in the (struct tm)
  1609. -      * as a number of _seconds_ _east_ of GMT.  Since this is an
  1610. -      * easterly pointing offset, we need to flip the sign to go the
  1611. -      * other direction.
  1612. -      */
  1613. -     return (int)(-tm->tm_gmtoff / 60);
  1614. - #endif
  1615.   
  1616. ! #ifdef TZMINS_USE_TZAZ_GLOBAL
  1617. ! #define TZMINS_HANDLING 3
  1618. !     /*
  1619. !      * This system maintains timezone offsets in global variables
  1620. !      * as a number of _seconds_ west of GMT.  There are two globals,
  1621. !      * one for when DST is in effect and one for when it is not,
  1622. !      * and we need to select the correct one.
  1623. !      */
  1624. !     {
  1625. !         extern long altzone, timezone;
  1626. !         return (int)((tm->tm_isdst ? altzone : timezone) / 60);
  1627. !     }
  1628. ! #endif
  1629.   
  1630. ! #ifdef TZMINS_USE_TZ_GLOBAL
  1631. ! #define TZMINS_HANDLING 4
  1632. !     /*
  1633. !      * This system maintains the timezone offset in a global variable as
  1634. !      * a number of _seconds_ west of GMT.  We need to correct this value
  1635. !      * if DST is in effect.  Note that the global "daylight" indicates
  1636. !      * that DST applies to this site and NOT necessarily that the DST
  1637. !      * correction needs to be applied right now.  Be careful -- some
  1638. !      * systems have a "timezone()" procedure and this method will return
  1639. !      * the address of that procedure rather than a timezone offset!
  1640. !      */
  1641. !     {
  1642. !         extern long timezone;
  1643. !         extern int daylight;
  1644. !         return (int)(timezone/60) -
  1645. !             ((daylight && tm->tm_isdst) ? 60 : 0);
  1646. !     }
  1647. ! #endif
  1648.   
  1649. ! #ifdef TZMINS_USE_TIMEOFDAY
  1650. ! #define TZMINS_HANDLING 5
  1651. !     /*
  1652. !      * This system uses gettimeofday() to obtain the timezone
  1653. !      * information as minutes west of GMT.  The returned value will
  1654. !      * not be corrected for DST (unless you are unlucky enough to
  1655. !      * own a Unix written by some unmentionable vendor), so we will
  1656. !      * need to account for that.  Be careful -- some systems that
  1657. !      * have this procedure depreciate its use for timezone information
  1658. !      * and recommend it only for the high-resolution time information.
  1659. !      * On these systems the timezone info may be some kernel default
  1660. !      * or even garbage.
  1661. !      */
  1662. !     {
  1663. !         struct timeval tv;
  1664. !         struct timezone tz;
  1665. !         (void) gettimeofday(&tv, &tz);
  1666. ! #ifdef AIX
  1667. !         return tz.tz_minuteswest;
  1668. ! #else
  1669. !         return tz.tz_minuteswest -
  1670. !             (tm->tm_isdst && tz.tz_dsttime != DST_NONE ? 60 : 0);
  1671. ! #endif
  1672. !     }
  1673. ! #endif
  1674.   
  1675. ! #ifdef TZMINS_USE_FTIME
  1676. ! #define TZMINS_HANDLING 6
  1677. !     /*
  1678. !      * This system uses ftime() to obtain the timezone information
  1679. !      * as minutes west of GMT.  The returned value will not be
  1680. !      * corrected for DST, so we will need to account for that.  Be
  1681. !      * careful -- some systems that have this procedure depreciate
  1682. !      * its use for timezone information and recommend it only for
  1683. !      * the high-resolution time information.  On these systems the
  1684. !      * timezone info may be some kernel default or even garbage.
  1685. !      */
  1686. !     {
  1687. !         struct timeb tb;
  1688. !         (void) ftime(&tb);
  1689. !         return tb.timezone - (tm->tm_isdst ? 60 : 0);
  1690. !     }
  1691. ! #endif
  1692.   
  1693. ! #ifndef TZMINS_HANDLING
  1694. !     /* Force a compile error if the timezone config is wrong. */
  1695. !     no_tzmins_handling_defined(TZMINS_HANDLING);
  1696. ! #endif
  1697.   }
  1698.   
  1699. ! /****************************************************************************/
  1700.   
  1701.   char *get_tz_name(tm)
  1702.   struct tm *tm;
  1703. --- 49,132 ----
  1704.   #ifdef I_SYSTIME
  1705.   #  include <sys/time.h>
  1706.   #endif
  1707.   
  1708.   #ifndef    _POSIX_SOURCE
  1709.   extern struct tm *localtime();
  1710. + extern struct tm *gmtime();
  1711.   extern time_t      time();
  1712.   #endif
  1713.   
  1714.   
  1715. ! #ifdef _CONFIGURE
  1716. ! /*
  1717. !  * The "Configure" program will try to determine the proper setting to make
  1718. !  * "get_tz_name()" work.  It will compile the program with _CONFIGURE enabled.
  1719. !  * We do not want to build "get_tz_mins()" when doing the config tests.
  1720. !  */
  1721. ! #define get_tz_mins() 0
  1722. ! main()
  1723.   {
  1724. !     char *get_tz_name();
  1725. !     puts(get_tz_name((struct tm *)0));
  1726. !     exit(0);
  1727. ! }
  1728.   #endif
  1729.   
  1730.   
  1731. ! #ifndef _CONFIGURE /*{*/
  1732. ! /*
  1733. !  * get_tz_mins() - Return the local timezone offset in minutes west of GMT.
  1734. !  *
  1735. !  * WARNING -- This routine will step on the static data returned by
  1736. !  * localtime() and gmtime().  Precautions must be taken in the calling
  1737. !  * routine to avoid trouncing the time information being used.
  1738. !  *
  1739. !  * An earlier version of Elm had a more complicated routine of the same
  1740. !  * name.  This implementation is more limited in that it calculates only
  1741. !  * the local TZ offset.  The old routine was able to calculate any TZ
  1742. !  * offset given a (struct tm *).
  1743. !  */
  1744. ! int get_tz_mins()
  1745. ! {
  1746. !     time_t tval;
  1747. !     struct tm *tm;
  1748. !     long t2, t1;
  1749. !     extern long make_gmttime(); /* from date_util.c */
  1750.   
  1751. !     time(&tval);
  1752.   
  1753. !     tm = localtime(&tval);
  1754. !     t1 = make_gmttime(tm->tm_year, tm->tm_mon, tm->tm_mday,
  1755. !         tm->tm_hour, tm->tm_min, tm->tm_sec);
  1756.   
  1757. !     tm = gmtime(&tval);
  1758. !     t2 = make_gmttime(tm->tm_year, tm->tm_mon, tm->tm_mday,
  1759. !         tm->tm_hour, tm->tm_min, tm->tm_sec);
  1760.   
  1761. !     return (int) ((t2-t1)/60);
  1762.   }
  1763. + #endif /*}!_CONFIGURE*/
  1764.   
  1765. ! /*
  1766. !  * get_tz_name(tm) - Return timezone name.
  1767. !  *
  1768. !  * Try to return the timezone name associated with the time specified by
  1769. !  * "tm", or the local timezone name if "tm" is NULL.  On some systems, you
  1770. !  * will get the local timezone name regardless of the "tm" value.
  1771. !  *
  1772. !  * Exactly one of the following definitions must be enabled to indicate
  1773. !  * the system-specific method for timezone name handling.
  1774. !  *
  1775. !  *    TZNAME_USE_TM_NAME     use (struct tm *)->tm_name
  1776. !  *    TZNAME_USE_TM_ZONE     use (struct tm *)->tm_zone
  1777. !  *    TZNAME_USE_TZNAME      use "tzname[]" external
  1778. !  *    TZNAME_USE_TIMEZONE    use timezone() function
  1779. !  *
  1780. !  * The TZNAME_HANDLING definition is just used to verify the configurations
  1781. !  * was setup correctly.  It will force a compiler warning or error if there
  1782. !  * is a configuration problem.
  1783. !  */
  1784.   
  1785.   char *get_tz_name(tm)
  1786.   struct tm *tm;
  1787. ***************
  1788. *** 245,254 ****
  1789.        * This system provides a timezone() procedure to get a timezone
  1790.        * name.  Be careful -- some systems have this procedure but
  1791.        * depreciate its use, and in some cases it is outright broke.
  1792.        */
  1793.       {
  1794.           extern char *timezone();
  1795. !         return timezone(get_tz_mins(tm), tm->tm_isdst);
  1796.       }
  1797.   #endif
  1798.   
  1799. --- 173,186 ----
  1800.        * This system provides a timezone() procedure to get a timezone
  1801.        * name.  Be careful -- some systems have this procedure but
  1802.        * depreciate its use, and in some cases it is outright broke.
  1803. +      * WARNING!!!  The "get_tz_mins()" routine is destructive
  1804. +      * to any (struct tm *) value that was obtained by gmtime() or
  1805. +      * localtime().
  1806.        */
  1807.       {
  1808.           extern char *timezone();
  1809. !         int isdst = tm->tm_isdst;
  1810. !         return timezone(get_tz_mins(), isdst);
  1811.       }
  1812.   #endif
  1813.   
  1814. ***************
  1815. *** 258,296 ****
  1816.   #endif
  1817.   }
  1818.   
  1819. - /****************************************************************************/
  1820.   
  1821.   #ifdef _TEST
  1822.   
  1823.   /*
  1824. !  * It would be best to futz around with the TZ setting when running this
  1825. !  * test.  In all cases, the "null" and the "localtime()" results should
  1826. !  * be identical, and the "gmtime()" results should indicate "GMT 0"
  1827. !  * regardless of TZ setting.  Here are a few possible TZ settings you
  1828. !  * can try, and the result you should expect.
  1829. !  *
  1830. !  *    TZ=GMT            always GMT 0
  1831. !  *    TZ=CST6CDT        CST 360 or CDT 300, depending upon time of year
  1832. !  *    TZ=EST5EDT        EST 300 or EDT 240, depending upon time of year
  1833. !  *    TZ=EST5EDT;0,364    always EDT 240
  1834. !  *    TZ=EST5EDT;0,0        always EST 300
  1835. !  *
  1836. !  * Oh...this all assumes your system supports TZ. :-)
  1837.    */
  1838.   
  1839.   main()
  1840.   {
  1841.       time_t t;
  1842. !     struct tm *tm;
  1843. !     static char f[] = "using %s tm struct - name=\"%s\" mins_west=\"%d\"\n";
  1844.   
  1845. !     (void) time(&t);
  1846. !     tm = (struct tm *)0;
  1847. !     printf(f, "null", get_tz_name(tm), get_tz_mins(tm));
  1848. !     tm = localtime(&t);
  1849. !     printf(f, "localtime()", get_tz_name(tm), get_tz_mins(tm));
  1850. !     tm = gmtime(&t);
  1851. !     printf(f, "gmtime()", get_tz_name(tm), get_tz_mins(tm));
  1852.       exit(0);
  1853.   }
  1854.   
  1855. --- 190,247 ----
  1856.   #endif
  1857.   }
  1858.   
  1859.   
  1860.   #ifdef _TEST
  1861.   
  1862.   /*
  1863. !  * This routine tests the timezone procedures by forcing a TZ value
  1864. !  * and checking the results.  This test routine is *not* portable.  It
  1865. !  * will work only on systems that (1) use the TZ environment parameter,
  1866. !  * (2) have a putenv() procedure, and (3) putenv() takes a single argument.
  1867.    */
  1868.   
  1869. + int debug = 1;
  1870. + FILE *debugfile = stderr;
  1871. + struct {
  1872. +     char *tz_setting;
  1873. +     char *expected_ans;
  1874. + } trytable[] = {
  1875. +     { "",            "local timezone setting" },
  1876. +     { "TZ=GMT",        "always GMT/0" },
  1877. +     { "TZ=CST6CDT",        "either CDT/300 or CST/360" },
  1878. +     { "TZ=EST5EDT",        "either EDT/240 or EST/300" },
  1879. +     { "TZ=EST5EDT;0,364",    "always EDT/240" },
  1880. +     { "TZ=EST5EDT;0,0",    "always EST/300" },
  1881. +     { NULL,            NULL }
  1882. + };
  1883.   main()
  1884.   {
  1885.       time_t t;
  1886. !     int i;
  1887. !     extern char *getenv();
  1888.   
  1889. !     puts("Notes:");
  1890. !     puts("\"get_tz_name(gmtime)\" trial should always show GMT.");
  1891. !     puts("\"get_tz_name(NULL)\" should match \"get_tz_name(localtime)\".");
  1892. !     puts("Results marked \"either/or\" depend whether DST in effect now.");
  1893. !     for (i = 0 ; trytable[i].tz_setting != NULL ; ++i) {
  1894. !         if (trytable[i].tz_setting[0] != '\0')
  1895. !             putenv(trytable[i].tz_setting);
  1896. !         putchar('\n');
  1897. !         printf("expected result: %s\n", trytable[i].expected_ans);
  1898. !         printf("getenv(\"TZ\") = \"%s\"\n", getenv("TZ"));
  1899. !         printf("get_tz_mins() = %d\n", get_tz_mins());
  1900. !         (void) time(&t);
  1901. !         printf("get_tz_name(NULL) = \"%s\"\n",
  1902. !             get_tz_name((struct tm *)0));
  1903. !         printf("get_tz_name(localtime) = \"%s\"\n",
  1904. !             get_tz_name(localtime(&t)));
  1905. !         printf("get_tz_name(gmtime) = \"%s\"\n",
  1906. !             get_tz_name(gmtime(&t)));
  1907. !     }
  1908.       exit(0);
  1909.   }
  1910.   
  1911.  
  1912. Index: lib/getarpdate.c
  1913. Prereq: 5.9
  1914. *** ../elm2.4/lib/getarpdate.c    Sun Sep 26 22:14:49 1993
  1915. --- lib/getarpdate.c    Fri Mar 11 15:55:24 1994
  1916. ***************
  1917. *** 1,7 ****
  1918. ! static char rcsid[] = "@(#)$Id: getarpdate.c,v 5.9 1993/08/03 19:17:33 syd Exp $";
  1919.   
  1920.   /*******************************************************************************
  1921. !  *  The Elm Mail System  -  $Revision: 5.9 $   $State: Exp $
  1922.    *
  1923.    *            Copyright (c) 1988-1992 USENET Community Trust
  1924.    *            Copyright (c) 1986,1987 Dave Taylor
  1925. --- 1,7 ----
  1926. ! static char rcsid[] = "@(#)$Id: getarpdate.c,v 5.10 1994/03/11 20:55:23 syd Exp $";
  1927.   
  1928.   /*******************************************************************************
  1929. !  *  The Elm Mail System  -  $Revision: 5.10 $   $State: Exp $
  1930.    *
  1931.    *            Copyright (c) 1988-1992 USENET Community Trust
  1932.    *            Copyright (c) 1986,1987 Dave Taylor
  1933. ***************
  1934. *** 13,18 ****
  1935. --- 13,32 ----
  1936.    *
  1937.    *******************************************************************************
  1938.    * $Log: getarpdate.c,v $
  1939. +  * Revision 5.10  1994/03/11  20:55:23  syd
  1940. +  * Replaced the get_tz_mins() routine in lib/get_tz.c with a portable
  1941. +  * version that requires no configuration.  Rewrote the test case in
  1942. +  * lib/get_tz.c, and also wrote in support to simplify configuration
  1943. +  * tests.  Dropped TZMINS_USE_XXXX configuration parameter.  Simplified
  1944. +  * timezone determination in Configure.  The new get_tz_mins() introduces
  1945. +  * two side effects.  First it steps on the static data returned by
  1946. +  * localtime().  Second, it uses a routine in lib/date_util.c, which
  1947. +  * requires debug initializations.  Rewrote get_arpa_date() to work around
  1948. +  * the first issue.  Rather than doing the same for lib/strftime.c, just
  1949. +  * removed the timezone stuff with a conditional compile.  Elm does not
  1950. +  * use it.  Added debugging initializations to util/fastmail.c.
  1951. +  * From: chip@chinacat.unicom.com (Chip Rosenthal)
  1952. +  *
  1953.    * Revision 5.9  1993/08/03  19:17:33  syd
  1954.    * Implement new timezone handling.  New file lib/get_tz.c with new timezone
  1955.    * routines.  Added new TZMINS_USE_xxxxxx and TZNAME_USE_xxxxxx configuration
  1956. ***************
  1957. *** 92,118 ****
  1958.       **/
  1959.   
  1960.       static char buffer[SLEN];    /* static character buffer       */
  1961. !     time_t       curr_time;        /* time in seconds....         */
  1962. !     struct tm *curr_tm;        /* Time structure, see CTIME(3C) */
  1963. !     long       tzmin;        /* number of minutes off gmt      */
  1964. !     char      *tzsign;        /* + or - gmt              */
  1965.       int      year;            /* current year - with century     */
  1966.   
  1967.       (void) time(&curr_time);
  1968. !     curr_tm = localtime(&curr_time);
  1969. !     if ((year = curr_tm->tm_year) < 100)
  1970.           year += 1900;
  1971. !     if ((tzmin = -get_tz_mins(curr_tm)) >= 0) {
  1972. !         tzsign = "+";
  1973.       } else {
  1974. !         tzsign = "-";
  1975.           tzmin = -tzmin;
  1976.       }
  1977. !     sprintf(buffer, "%s, %d %s %d %02d:%02d:%02d %s%02d%02d (%s)",
  1978. !       arpa_dayname[curr_tm->tm_wday],
  1979. !       curr_tm->tm_mday, arpa_monname[curr_tm->tm_mon], year,
  1980. !       curr_tm->tm_hour, curr_tm->tm_min, curr_tm->tm_sec,
  1981. !       tzsign, tzmin / 60, tzmin % 60, get_tz_name(curr_tm));
  1982.       
  1983.       return buffer;
  1984.   }
  1985. --- 106,155 ----
  1986.       **/
  1987.   
  1988.       static char buffer[SLEN];    /* static character buffer       */
  1989. !     time_t      curr_time;        /* time in seconds....         */
  1990. !     struct tm curr_tm;        /* Time structure, see CTIME(3C) */
  1991. !     long      tzmin;        /* number of minutes off gmt      */
  1992. !     int      tzsign;        /* + or - gmt              */
  1993.       int      year;            /* current year - with century     */
  1994.   
  1995. +     /*
  1996. +      * The get_tz_mins() routine steps on the static data returned
  1997. +      * by localtime(), so we need to save off the value obtained here.
  1998. +      */
  1999.       (void) time(&curr_time);
  2000. !     curr_tm = *localtime(&curr_time);
  2001. !     if ((year = curr_tm.tm_year) < 100)
  2002.           year += 1900;
  2003. !     if ((tzmin = -get_tz_mins()) >= 0) {
  2004. !         tzsign = '+';
  2005.       } else {
  2006. !         tzsign = '-';
  2007.           tzmin = -tzmin;
  2008.       }
  2009. !     sprintf(buffer, "%s, %d %s %d %02d:%02d:%02d %c%02d%02d (%s)",
  2010. !       arpa_dayname[curr_tm.tm_wday],
  2011. !       curr_tm.tm_mday, arpa_monname[curr_tm.tm_mon], year,
  2012. !       curr_tm.tm_hour, curr_tm.tm_min, curr_tm.tm_sec,
  2013. !       tzsign, tzmin / 60, tzmin % 60, get_tz_name(&curr_tm));
  2014.       
  2015.       return buffer;
  2016.   }
  2017. + #ifdef _TEST
  2018. + int debug = 1;
  2019. + FILE *debugfile = stderr;
  2020. + main()
  2021. + {
  2022. +     printf("system(\"date\") says:   ");
  2023. +     fflush(stdout);
  2024. +     system("date");
  2025. +     fflush(stdout);
  2026. +     printf("get_arpa_date() says:  %s\n", get_arpa_date());
  2027. +     exit(0);
  2028. + }
  2029. + #endif
  2030.  
  2031.