home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume35 / remind / patch02b / patch.02.A
Encoding:
Text File  |  1993-02-05  |  57.6 KB  |  2,034 lines

  1. Prereq: "03.00.01"
  2. *** ../patch1/version.h    Wed Dec 16 10:51:27 1992
  3. --- ./version.h    Fri Jan  8 13:22:45 1993
  4. ***************
  5. *** 5,12 ****
  6.   /*  What version of remind do we have?                         */
  7.   /*                                                             */
  8.   /*  This file is part of REMIND.                               */
  9. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  10.   /*                                                             */
  11.   /***************************************************************/
  12.   
  13. ! #define VERSION "03.00.01"
  14. --- 5,12 ----
  15.   /*  What version of remind do we have?                         */
  16.   /*                                                             */
  17.   /*  This file is part of REMIND.                               */
  18. ! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  19.   /*                                                             */
  20.   /***************************************************************/
  21.   
  22. ! #define VERSION "03.00.02"
  23. *** ../patch1/COPYRIGHT    Wed Dec 16 10:51:23 1992
  24. --- ./COPYRIGHT    Fri Jan  8 13:26:53 1993
  25. ***************
  26. *** 3,10 ****
  27.   REMIND refers to the entire set of files and documentation in the
  28.   REMIND package.
  29.   
  30. ! REMIND is Copyright 1990, 1991, 1992 by David Skoll, except for the
  31. ! file remind-all.sh, which is Copyright 1990 by Bill Aten.
  32.   
  33.   You may use REMIND for free, and may freely distribute it, providing
  34.   you do not charge the recipients to whom you distribute REMIND.
  35. --- 3,10 ----
  36.   REMIND refers to the entire set of files and documentation in the
  37.   REMIND package.
  38.   
  39. ! REMIND is Copyright 1990, 1991, 1992, 1993 by David Skoll, except for
  40. ! the file remind-all.sh, which is Copyright 1990 by Bill Aten.
  41.   
  42.   You may use REMIND for free, and may freely distribute it, providing
  43.   you do not charge the recipients to whom you distribute REMIND.
  44. ***************
  45. *** 16,23 ****
  46.   
  47.   You may incorporate parts of REMIND into your own programs, providing
  48.   you do not sell these programs.  You must clearly indicate that the
  49. ! parts of REMIND you have incorporated are Copyright 1990, 1991, 1992
  50. ! by David Skoll.
  51.   
  52.   I will attempt to support REMIND as much as possible.  However, you
  53.   use it at your own risk.  I am not responsible for any damages caused
  54. --- 16,23 ----
  55.   
  56.   You may incorporate parts of REMIND into your own programs, providing
  57.   you do not sell these programs.  You must clearly indicate that the
  58. ! parts of REMIND you have incorporated are Copyright 1990, 1991, 1992,
  59. ! 1993 by David Skoll.
  60.   
  61.   I will attempt to support REMIND as much as possible.  However, you
  62.   use it at your own risk.  I am not responsible for any damages caused
  63. *** ../patch1/MANIFEST.DOS    Wed Dec 16 10:51:55 1992
  64. --- ./MANIFEST.DOS    Mon Jan 25 15:40:01 1993
  65. ***************
  66. *** 4,19 ****
  67. --- 4,22 ----
  68.   defs.rem
  69.   dorem.c
  70.   dosubst.c
  71. + english.h
  72.   err.h
  73.   expr.c
  74.   expr.h
  75.   files.c
  76.   funcs.c
  77. + german.h
  78.   globals.c
  79.   globals.h
  80.   init.c
  81.   kall
  82.   kall.1
  83. + lang.h
  84.   lnk.msc
  85.   lnk.tc
  86.   main.c
  87. ***************
  88. *** 43,48 ****
  89. --- 46,52 ----
  90.   test.rem
  91.   token.c
  92.   trigger.c
  93. + tstlang.rem
  94.   types.h
  95.   userfns.c
  96.   utils.c
  97. *** ../patch1/MANIFEST.UNX    Wed Dec 16 10:51:55 1992
  98. --- ./MANIFEST.UNX    Mon Jan 25 15:39:51 1993
  99. ***************
  100. *** 11,26 ****
  101. --- 11,29 ----
  102.   defs.rem
  103.   dorem.c
  104.   dosubst.c
  105. + english.h
  106.   err.h
  107.   expr.c
  108.   expr.h
  109.   files.c
  110.   funcs.c
  111. + german.h
  112.   globals.c
  113.   globals.h
  114.   init.c
  115.   kall
  116.   kall.1
  117. + lanh.h
  118.   lnk.msc
  119.   lnk.tc
  120.   main.c
  121. ***************
  122. *** 44,49 ****
  123. --- 47,53 ----
  124.   test.rem
  125.   token.c
  126.   trigger.c
  127. + tstlang.rem
  128.   types.h
  129.   userfns.c
  130.   utils.c
  131. *** ../patch1/Makefile    Wed Dec 16 10:54:10 1992
  132. --- ./Makefile    Mon Jan 25 15:39:39 1993
  133. ***************
  134. *** 45,54 ****
  135.   # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  136.   # in config.h; then, you should be able to type 'make'.
  137.   #-----------------------------------------------------------------------------
  138. ! VERSION= 03.00.01
  139.   
  140. ! HDRS= config.h err.h expr.h globals.h protos.h types.h version.h
  141. ! STDHDRS= config.h types.h protos.h globals.h err.h
  142.   SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
  143.   main.c omit.c queue.c token.c trigger.c userfns.c utils.c var.c
  144.   
  145. --- 45,54 ----
  146.   # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  147.   # in config.h; then, you should be able to type 'make'.
  148.   #-----------------------------------------------------------------------------
  149. ! VERSION= 03.00.02
  150.   
  151. ! HDRS= config.h err.h expr.h globals.h protos.h types.h version.h lang.h
  152. ! STDHDRS= config.h types.h protos.h globals.h err.h lang.h
  153.   SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
  154.   main.c omit.c queue.c token.c trigger.c userfns.c utils.c var.c
  155.   
  156. ***************
  157. *** 55,61 ****
  158.   MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
  159.   remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
  160.   makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1 \
  161. ! defs.rem README.OS2 makefile.os2 rem2ps.c rem2ps.h remind.def rem2ps.1
  162.   
  163.   OBJS= $(SRCS:.c=.o)
  164.   
  165. --- 55,62 ----
  166.   MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
  167.   remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
  168.   makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1 \
  169. ! defs.rem README.OS2 makefile.os2 rem2ps.c rem2ps.h remind.def rem2ps.1 \
  170. ! lang.h english.h german.h tstlang.rem
  171.   
  172.   OBJS= $(SRCS:.c=.o)
  173.   
  174. ***************
  175. *** 73,79 ****
  176.   clean:
  177.       rm -f *.o *~
  178.   
  179. ! rem2ps.o: rem2ps.c
  180.   calendar.o: calendar.c $(STDHDRS) expr.h
  181.   dorem.o: dorem.c $(STDHDRS) expr.h
  182.   dosubst.o: dosubst.c $(STDHDRS)
  183. --- 74,86 ----
  184.   clean:
  185.       rm -f *.o *~
  186.   
  187. ! clobber:
  188. !     rm -f *.o *~ remind rem2ps test.out
  189. ! test: remind
  190. !     sh test-rem
  191. ! rem2ps.o: rem2ps.c rem2ps.h lang.h config.h
  192.   calendar.o: calendar.c $(STDHDRS) expr.h
  193.   dorem.o: dorem.c $(STDHDRS) expr.h
  194.   dosubst.o: dosubst.c $(STDHDRS)
  195. ***************
  196. *** 80,86 ****
  197.   expr.o: expr.c $(STDHDRS) expr.h
  198.   files.o: files.c $(STDHDRS)
  199.   funcs.o: funcs.c $(STDHDRS) expr.h version.h
  200. ! globals.o: globals.c config.h types.h globals.h err.h
  201.   init.o: init.c $(STDHDRS) expr.h version.h
  202.   main.o: main.c $(STDHDRS) expr.h
  203.   omit.o: omit.c $(STDHDRS)
  204. --- 87,93 ----
  205.   expr.o: expr.c $(STDHDRS) expr.h
  206.   files.o: files.c $(STDHDRS)
  207.   funcs.o: funcs.c $(STDHDRS) expr.h version.h
  208. ! globals.o: globals.c config.h types.h globals.h err.h lang.h
  209.   init.o: init.c $(STDHDRS) expr.h version.h
  210.   main.o: main.c $(STDHDRS) expr.h
  211.   omit.o: omit.c $(STDHDRS)
  212. ***************
  213. *** 92,99 ****
  214.   var.o: var.c $(STDHDRS) expr.h
  215.   
  216.   tarZ:
  217. !     tar cvf remind-3.0.1.tar $(MANIFEST)
  218. !     compress -v remind-3.0.1.tar
  219.   
  220.   shar:
  221.       shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
  222. --- 99,106 ----
  223.   var.o: var.c $(STDHDRS) expr.h
  224.   
  225.   tarZ:
  226. !     tar cvf remind-3.0.2.tar $(MANIFEST)
  227. !     compress -v remind-3.0.2.tar
  228.   
  229.   shar:
  230.       shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
  231. *** ../patch1/README.DOS    Wed Dec 16 10:51:22 1992
  232. --- ./README.DOS    Fri Jan 22 11:08:58 1993
  233. ***************
  234. *** 17,22 ****
  235. --- 17,43 ----
  236.   
  237.   The file "defs.rem" has some sample Remind definitions and commands.
  238.   
  239. + OTHER LANGUAGE SUPPORT
  240. + Remind has limited support for languages other than English.  See the file
  241. + "lang.h" for details.  Only the substitution filter and names of days and
  242. + months are affected - error and usage messages are still in English.
  243. + If you add support for a non-English language, Remind will accept both the
  244. + English and non-English names of months and weekdays in an input script.
  245. + However, you should not rely on this feature if you want to write portable
  246. + Remind scripts.
  247. + Take a look at the files "english.h" and "german.h" if you want to add
  248. + support for your favourite language.  If you do add another language
  249. + to Remind, please let me know!  Here are the basic guidelines:
  250. + - Your language file should be called "lxxx.h", where lxxx is the first 8
  251. + characters of the ENGLISH name of your language.
  252. + - You should define L_LANGNAME to be the full English name of your language,
  253. +   with the first letter capitalized and the rest lower-case.
  254.   --
  255.   David F. Skoll <dfs@doe.carleton.ca>
  256.   4-317 LeBreton Street South
  257. *** ../patch1/README.OS2    Wed Dec 16 10:52:02 1992
  258. --- ./README.OS2    Fri Jan 22 11:08:54 1993
  259. ***************
  260. *** 25,30 ****
  261. --- 25,51 ----
  262.   OS/2 support is courtesy of DARREL HANKERSON <HANK@DUCVAX.AUBURN.EDU>.
  263.   However, if you have problems, please contact me and not Darrel.
  264.   
  265. + OTHER LANGUAGE SUPPORT
  266. + Remind has limited support for languages other than English.  See the file
  267. + "lang.h" for details.  Only the substitution filter and names of days and
  268. + months are affected - error and usage messages are still in English.
  269. + If you add support for a non-English language, Remind will accept both the
  270. + English and non-English names of months and weekdays in an input script.
  271. + However, you should not rely on this feature if you want to write portable
  272. + Remind scripts.
  273. + Take a look at the files "english.h" and "german.h" if you want to add
  274. + support for your favourite language.  If you do add another language
  275. + to Remind, please let me know!  Here are the basic guidelines:
  276. + - Your language file should be called "lxxx.h", where lxxx is the first 8
  277. + characters of the ENGLISH name of your language.
  278. + - You should define L_LANGNAME to be the full English name of your language,
  279. +   with the first letter capitalized and the rest lower-case.
  280.   --
  281.   David F. Skoll <dfs@doe.carleton.ca>
  282.   4-317 LeBreton Street South
  283. *** ../patch1/README.UNIX    Wed Dec 16 10:51:21 1992
  284. --- ./README.UNIX    Fri Jan 29 13:43:01 1993
  285. ***************
  286. *** 14,24 ****
  287.   
  288.   4 - Examine the file config.h and adjust parameters as needed
  289.   
  290. ! 5 - Type 'make'
  291.   
  292. ! 6 - Type 'sh test-rem' to run the acceptance test
  293.   
  294. ! 7 - Type 'make install' to install Remind, kall, rem and the man
  295.       pages.
  296.   
  297.   Two shell scripts, "remind-all.csh" and "remind-all.sh" are provided.
  298. --- 14,27 ----
  299.   
  300.   4 - Examine the file config.h and adjust parameters as needed
  301.   
  302. ! 5 - Examine lang.h and choose the language you want Remind to use.
  303.   
  304. ! 6 - Type 'make'
  305.   
  306. ! 7 - Type 'sh test-rem' or 'make test' to run the acceptance test.  Note
  307. !     that the test script works only for the English version of Remind.
  308. ! 8 - Type 'make install' to install Remind, kall, rem and the man
  309.       pages.
  310.   
  311.   Two shell scripts, "remind-all.csh" and "remind-all.sh" are provided.
  312. ***************
  313. *** 51,56 ****
  314. --- 54,81 ----
  315.   depends on the output of "ps", and may not be portable.
  316.   
  317.   The file "defs.rem" has some sample Remind definitions and commands.
  318. + OTHER LANGUAGE SUPPORT
  319. + Remind has limited support for languages other than English.  See the file
  320. + "lang.h" for details.  Only the substitution filter and names of days and
  321. + months are affected - error and usage messages are still in English.
  322. + If you add support for a non-English language, Remind will accept both the
  323. + English and non-English names of months and weekdays in an input script.
  324. + However, you should not rely on this feature if you want to write portable
  325. + Remind scripts.
  326. + Take a look at the files "english.h" and "german.h" if you want to add
  327. + support for your favourite language.  If you do add another language
  328. + to Remind, please let me know!  Here are the basic guidelines:
  329. + - Your language file should be called "lxxx.h", where lxxx is the first 8
  330. +   characters of the ENGLISH name of your language.
  331. + - Your language file should define L_LANGNAME to be the full English
  332. +   name of your language, with the first letter capitalized and the rest
  333. +   lower-case.
  334.   
  335.   --
  336.   David F. Skoll <dfs@doe.carleton.ca>
  337. *** ../patch1/WHATSNEW.30    Wed Dec 16 10:51:56 1992
  338. --- ./WHATSNEW.30    Mon Feb  1 12:29:52 1993
  339. ***************
  340. *** 2,10 ****
  341.   
  342.   *** PLEASE NOTE:  AFTER 24 FEBRUARY, 1993, MY NEW ADDRESS WILL BE:
  343.   986 Eiffel Avenue,
  344. ! Ottawa, Ontario
  345.   Canada
  346.   
  347.   * Version 3.0 Patch 1
  348.   
  349.   - Wrote the Rem2ps program to produce PostScript calendars
  350. --- 2,50 ----
  351.   
  352.   *** PLEASE NOTE:  AFTER 24 FEBRUARY, 1993, MY NEW ADDRESS WILL BE:
  353.   986 Eiffel Avenue,
  354. ! Ottawa, Ontario K2C 0J2
  355.   Canada
  356.   
  357. + * Version 3.0 Patch 2
  358. + - Added the -u option to Remind so that root can run it as any user.
  359. +   This simplifies the remind-all scripts, and makes them more efficient.
  360. +   If you are worried that this option is a security hole, you can
  361. +   disable it in config.h
  362. + - Changed the RUN command so that RUN OFF can be used anywhere, even
  363. +   though RUN ON only works in the top-level file.  This eases the
  364. +   management of global files which may want to switch RUN OFF.
  365. + - Added ISO encoding (ISO 8859-1) to the PostScript output, courtesy of
  366. +   Michael Salmon.  This can be selected with the '-i' option in rem2ps.
  367. + - Added support for the '-' date separator as well as the '/' separator.
  368. + - Added support for languages other than English.  Note that this support
  369. +   is not complete - error messages are still in English.  The idea and
  370. +   German translation came from Wolfgang Thronicke.
  371. + - Changed the -w option to include the "padding" and "spacing" options.
  372. +   NOTE INCOMPATIBILITY:  In the previous patch level, creating a weekly
  373. +   calendar using the -c+n option left no blank lines between the day
  374. +   number and the first reminder entry.  This has been changed so that one
  375. +   blank line is left.  To revert to the old behaviour, use the "-w,,0"
  376. +   option.
  377. + - Added the -o option to Rem2ps.  This allows you to specify the margins
  378. +   when producing a PostScript calendar.
  379. + - Updated the copyright notices in all the files. :-)
  380. + - Added 'make clobber' and 'make test' targets to the Unix makefile.
  381. + - Corrected typos in WHATSNEW.30 and remind.1 man page.  Thanks to
  382. +   Dave Wolfe <dwolfe@pffft.sps.mot.com>
  383. + - Changed Remind so that supplying the -a option causes timed reminders
  384. +   not to be placed into the calendar in calendar mode.
  385.   * Version 3.0 Patch 1
  386.   
  387.   - Wrote the Rem2ps program to produce PostScript calendars
  388. ***************
  389. *** 66,72 ****
  390.   - Fixed a lurking bug in trigger date calculation which, amazingly, had not
  391.     been caught in the couple of years that Remind has been out!
  392.   
  393. ! * Version 2.4 Patch 5 
  394.   
  395.   - Added the "c+n" option for printing a calendar by
  396.     weeks instead of months, courtesy Dennis Cottel (dennis@peanuts.nosc.mil).
  397. --- 106,112 ----
  398.   - Fixed a lurking bug in trigger date calculation which, amazingly, had not
  399.     been caught in the couple of years that Remind has been out!
  400.   
  401. ! * Version 2.3 Patch 5 
  402.   
  403.   - Added the "c+n" option for printing a calendar by
  404.     weeks instead of months, courtesy Dennis Cottel (dennis@peanuts.nosc.mil).
  405. *** ../patch1/calendar.c    Wed Dec 16 10:51:29 1992
  406. --- ./calendar.c    Fri Jan 22 10:26:13 1993
  407. ***************
  408. *** 5,11 ****
  409.   /*  The code for generating a calendar.                        */
  410.   /*                                                             */
  411.   /*  This file is part of REMIND.                               */
  412. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  413.   /*                                                             */
  414.   /***************************************************************/
  415.   #include "config.h"
  416. --- 5,11 ----
  417.   /*  The code for generating a calendar.                        */
  418.   /*                                                             */
  419.   /*  This file is part of REMIND.                               */
  420. ! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  421.   /*                                                             */
  422.   /***************************************************************/
  423.   #include "config.h"
  424. ***************
  425. *** 105,111 ****
  426.   static void DoCalendarOneWeek()
  427.   #endif
  428.   {
  429. !    int y, m, d, done, i;
  430.      char buf[81];
  431.      int LinesWritten = 0;
  432.      int OrigJul = JulianToday;
  433. --- 105,111 ----
  434.   static void DoCalendarOneWeek()
  435.   #endif
  436.   {
  437. !    int y, m, d, done, i, l;
  438.      char buf[81];
  439.      int LinesWritten = 0;
  440.      int OrigJul = JulianToday;
  441. ***************
  442. *** 118,124 ****
  443.   
  444.   /* Output the entries */
  445.   
  446. ! /* Here come the first two lines... */
  447.      putchar('|');
  448.      for (i=0; i<7; i++) {
  449.         FromJulian(OrigJul+i, &y, &m, &d);
  450. --- 118,124 ----
  451.   
  452.   /* Output the entries */
  453.   
  454. ! /* Here come the first few lines... */
  455.      putchar('|');
  456.      for (i=0; i<7; i++) {
  457.         FromJulian(OrigJul+i, &y, &m, &d);
  458. ***************
  459. *** 131,144 ****
  460.         putchar('|');
  461.      }
  462.      putchar('\n');
  463. ! /*** Take out blank line in weekly calendar display - takes up room
  464. !    putchar('|');
  465. !    for (i=0; i<7; i++) {
  466. !       PrintLeft("", ColSpaces, ' ');
  467.         putchar('|');
  468.      }
  469. !    putchar('\n');
  470. ! ***/
  471.   /* Write the body lines */
  472.      done = 0;
  473.      while (!done) {
  474. --- 131,145 ----
  475.         putchar('|');
  476.      }
  477.      putchar('\n');
  478. !    for (l=0; l<CalPad; l++) {
  479.         putchar('|');
  480. +       for (i=0; i<7; i++) {
  481. +          PrintLeft("", ColSpaces, ' ');
  482. +          putchar('|');
  483. +       }
  484. +       putchar('\n');
  485.      }
  486.   /* Write the body lines */
  487.      done = 0;
  488.      while (!done) {
  489. ***************
  490. *** 147,153 ****
  491.      }
  492.   
  493.   /* Write any blank lines required */
  494. !    while (LinesWritten++ < CAL_LINES) {
  495.         putchar('|');
  496.         for (i=0; i<7; i++) {
  497.            PrintLeft("", ColSpaces, ' ');
  498. --- 148,154 ----
  499.      }
  500.   
  501.   /* Write any blank lines required */
  502. !    while (LinesWritten++ < CalLines) {
  503.         putchar('|');
  504.         for (i=0; i<7; i++) {
  505.            PrintLeft("", ColSpaces, ' ');
  506. ***************
  507. *** 213,219 ****
  508.   static int WriteCalendarRow()
  509.   #endif
  510.   {
  511. !    int y, m, d, wd, i;
  512.      int done;
  513.      char buf[81];
  514.      int OrigJul = JulianToday;
  515. --- 214,220 ----
  516.   static int WriteCalendarRow()
  517.   #endif
  518.   {
  519. !    int y, m, d, wd, i, l;
  520.      int done;
  521.      char buf[81];
  522.      int OrigJul = JulianToday;
  523. ***************
  524. *** 241,247 ****
  525.      }
  526.    
  527.   
  528. ! /* Here come the first two lines... */
  529.      putchar('|');
  530.      for (i=0; i<7; i++) {
  531.         if (i < wd || d+i-wd>DaysInMonth(m, y))
  532. --- 242,248 ----
  533.      }
  534.    
  535.   
  536. ! /* Here come the first few lines... */
  537.      putchar('|');
  538.      for (i=0; i<7; i++) {
  539.         if (i < wd || d+i-wd>DaysInMonth(m, y))
  540. ***************
  541. *** 253,264 ****
  542.         putchar('|');
  543.      }
  544.      putchar('\n');
  545. !    putchar('|');
  546. !    for (i=0; i<7; i++) {
  547. !       PrintLeft("", ColSpaces, ' ');
  548.         putchar('|');
  549.      }
  550. -    putchar('\n');
  551.   
  552.   /* Write the body lines */
  553.      done = 0;
  554. --- 254,267 ----
  555.         putchar('|');
  556.      }
  557.      putchar('\n');
  558. !    for (l=0; l<CalPad; l++) {
  559.         putchar('|');
  560. +       for (i=0; i<7; i++) {
  561. +          PrintLeft("", ColSpaces, ' ');
  562. +          putchar('|');
  563. +       }
  564. +       putchar('\n');
  565.      }
  566.   
  567.   /* Write the body lines */
  568.      done = 0;
  569. ***************
  570. *** 268,274 ****
  571.      }
  572.   
  573.   /* Write any blank lines required */
  574. !    while (LinesWritten++ < CAL_LINES) {
  575.         putchar('|');
  576.         for (i=0; i<7; i++) {
  577.            PrintLeft("", ColSpaces, ' ');
  578. --- 271,277 ----
  579.      }
  580.   
  581.   /* Write any blank lines required */
  582. !    while (LinesWritten++ < CalLines) {
  583.         putchar('|');
  584.         for (i=0; i<7; i++) {
  585.            PrintLeft("", ColSpaces, ' ');
  586. ***************
  587. *** 615,620 ****
  588. --- 618,627 ----
  589.      /* Parse the trigger date and time */
  590.      if (r=ParseRem(p, &trig, &tim)) return r;
  591.   
  592. + /* Don't include timed reminders in calendar if -a option supplied. */
  593. + #ifdef HAVE_QUEUED
  594. +    if (DontIssueAts && tim.ttime != NO_TIME) return OK;
  595. + #endif
  596.      if (trig.typ == NO_TYPE) return E_EOLN;
  597.      if (trig.typ == SAT_TYPE) return DoSatRemind(&trig, &tim, p);
  598.      /* Calculate the trigger date */
  599. ***************
  600. *** 666,672 ****
  601.   
  602.      FromJulian(jul, &y, &m, &d);
  603.      while(e) {
  604. !       printf("%04d/%02d/%02d ", y, m+1, d);
  605.         printf("%s\n", e->text);
  606.         free(e->text);
  607.         n = e->next;
  608. --- 673,679 ----
  609.   
  610.      FromJulian(jul, &y, &m, &d);
  611.      while(e) {
  612. !       printf("%04d%c%02d%c%02d ", y, DATESEP, m+1, DATESEP, d);
  613.         printf("%s\n", e->text);
  614.         free(e->text);
  615.         n = e->next;
  616. ***************
  617. *** 812,815 ****
  618.         }
  619.      }
  620.   }
  621. --- 819,821 ----
  622. *** ../patch1/config.h    Wed Dec 16 10:51:23 1992
  623. --- ./config.h    Mon Feb  1 12:21:15 1993
  624. ***************
  625. *** 7,15 ****
  626.   /*  care of certain system dependencies.                       */
  627.   /*                                                             */
  628.   /*  This file is part of REMIND.                               */
  629. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  630.   /*                                                             */
  631.   /***************************************************************/
  632.   
  633.   /*---------------------------------------------------------------------*/
  634.   /* STRSTR:  If your system does not have the "strstr" function,        */
  635. --- 7,29 ----
  636.   /*  care of certain system dependencies.                       */
  637.   /*                                                             */
  638.   /*  This file is part of REMIND.                               */
  639. ! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  640.   /*                                                             */
  641.   /***************************************************************/
  642. + /*---------------------------------------------------------------------*/
  643. + /* DATESEP:  The default date separator.  North American usage is '/'; */
  644. + /* others may prefer '-'.                                              */
  645. + /*---------------------------------------------------------------------*/
  646. + #define DATESEP '/'
  647. + /* #define DATESEP '-' */
  648. + /*---------------------------------------------------------------------*/
  649. + /* WANT_U_OPTION: Comment out the next define to permanently disable   */
  650. + /* the -u option.  If you do this, however, remind-all.[c]sh will not  */
  651. + /* work.                                                               */
  652. + /*---------------------------------------------------------------------*/
  653. + #define WANT_U_OPTION 1
  654.   
  655.   /*---------------------------------------------------------------------*/
  656.   /* STRSTR:  If your system does not have the "strstr" function,        */
  657. *** ../patch1/defs.rem    Wed Dec 16 10:51:58 1992
  658. --- ./defs.rem    Fri Jan  8 13:26:17 1993
  659. ***************
  660. *** 6,12 ****
  661.   # Cut and paste as desired!
  662.   #
  663.   # This file is part of REMIND.
  664. ! # Copyright (C) 1992 by David F. Skoll
  665.   #
  666.   # ---------------------------------------------------------------------------
  667.   
  668. --- 6,12 ----
  669.   # Cut and paste as desired!
  670.   #
  671.   # This file is part of REMIND.
  672. ! # Copyright (C) 1992, 1993 by David F. Skoll
  673.   #
  674.   # ---------------------------------------------------------------------------
  675.   
  676. *** ../patch1/dorem.c    Wed Dec 16 10:51:30 1992
  677. --- ./dorem.c    Fri Jan 22 10:25:12 1993
  678. ***************
  679. *** 7,13 ****
  680.   /*  commands.                                                  */
  681.   /*                                                             */
  682.   /*  This file is part of REMIND.                               */
  683. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  684.   /*                                                             */
  685.   /***************************************************************/
  686.   #include "config.h"
  687. --- 7,13 ----
  688.   /*  commands.                                                  */
  689.   /*                                                             */
  690.   /*  This file is part of REMIND.                               */
  691. ! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  692.   /*                                                             */
  693.   /***************************************************************/
  694.   #include "config.h"
  695. ***************
  696. *** 415,421 ****
  697.         if (r=DoSubst(p, SubstBuffer, t, tim, jul, CAL_MODE)) return r;
  698.         if (!*SubstBuffer) return OK;
  699.         FromJulian(jul, &y, &m, &d);
  700. !       printf("%04d/%02d/%02d %s%s\n", y, m+1, d,
  701.                                         SimpleTime(tim->ttime, NULL),
  702.                                         SubstBuffer);
  703.         return OK;
  704. --- 415,421 ----
  705.         if (r=DoSubst(p, SubstBuffer, t, tim, jul, CAL_MODE)) return r;
  706.         if (!*SubstBuffer) return OK;
  707.         FromJulian(jul, &y, &m, &d);
  708. !       printf("%04d%c%02d%c%02d %s%s\n", y, DATESEP, m+1, DATESEP, d,
  709.                                         SimpleTime(tim->ttime, NULL),
  710.                                         SubstBuffer);
  711.         return OK;
  712. *** ../patch1/dosubst.c    Wed Dec 16 10:51:30 1992
  713. --- ./dosubst.c    Mon Jan 25 16:09:28 1993
  714. ***************
  715. *** 6,14 ****
  716.   /*  reminders are triggered.                                   */
  717.   /*                                                             */
  718.   /*  This file is part of REMIND.                               */
  719. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  720.   /*                                                             */
  721.   /***************************************************************/
  722.   #include "config.h"
  723.   #include <stdio.h>
  724.   #include <ctype.h>
  725. --- 6,15 ----
  726.   /*  reminders are triggered.                                   */
  727.   /*                                                             */
  728.   /*  This file is part of REMIND.                               */
  729. ! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  730.   /*                                                             */
  731.   /***************************************************************/
  732. + #define L_IN_DOSUBST
  733.   #include "config.h"
  734.   #include <stdio.h>
  735.   #include <ctype.h>
  736. ***************
  737. *** 29,36 ****
  738.   #define NL "\n"
  739.   #endif
  740.   
  741. ! static char TODAY[] = "today";
  742. ! static char TOMORROW[] = "tomorrow";
  743.   
  744.   /***************************************************************/
  745.   /*                                                             */
  746. --- 30,37 ----
  747.   #define NL "\n"
  748.   #endif
  749.   
  750. ! static char TODAY[] = L_TODAY;
  751. ! static char TOMORROW[] = L_TOMORROW;
  752.   
  753.   /***************************************************************/
  754.   /*                                                             */
  755. ***************
  756. *** 74,82 ****
  757.      adiff = ABS(tdiff);
  758.      mdiff = adiff % 60;
  759.      hdiff = adiff / 60;
  760. !    mplu = (mdiff == 1 ? "" : "s");
  761. !    hplu = (hdiff == 1 ? "" : "s");
  762. !    when = (tdiff < 0 ? "ago" : "from now");
  763.      
  764.      h = tim / 60;
  765.      min = tim % 60;
  766. --- 75,83 ----
  767.      adiff = ABS(tdiff);
  768.      mdiff = adiff % 60;
  769.      hdiff = adiff / 60;
  770. !    mplu = (mdiff == 1 ? "" : L_MPLU);
  771. !    hplu = (hdiff == 1 ? "" : L_HPLU);
  772. !    when = (tdiff < 0 ? L_AGO : L_FROMNOW);
  773.      
  774.      h = tim / 60;
  775.      min = tim % 60;
  776. ***************
  777. *** 90,95 ****
  778. --- 91,99 ----
  779.      cpm = (ch < 12) ? "am" : "pm";
  780.      chh = (ch == 12) ? 12 : ch % 12;
  781.   
  782. + #ifdef L_ORDINAL_OVERRIDE
  783. + L_ORDINAL_OVERRIDE
  784. + #else
  785.      switch(d) {
  786.         case 1:
  787.         case 21:
  788. ***************
  789. *** 103,109 ****
  790.         
  791.         default: plu = "th"; break;
  792.      }
  793. !       
  794.      
  795.      while(1) {
  796.         c = ParseChar(p, &err, 0);
  797. --- 107,113 ----
  798.         
  799.         default: plu = "th"; break;
  800.      }
  801. ! #endif      
  802.      
  803.      while(1) {
  804.         c = ParseChar(p, &err, 0);
  805. ***************
  806. *** 128,146 ****
  807.         done = 0;
  808.         if (diff <= 1) {
  809.            switch(UPPER(c)) {
  810.               case 'A':
  811.               case 'B':
  812.           case 'C':
  813.           case 'E':
  814.           case 'F':
  815.           case 'G':
  816.           case 'H':
  817.           case 'I':
  818.           case 'J':
  819.           case 'K':
  820.           case 'L':
  821.           case 'U':
  822. !         case 'V': sprintf(s, "%s", (diff ? TOMORROW : TODAY));
  823.                    s += strlen(s);
  824.                    done = 1;
  825.                     break;
  826. --- 132,177 ----
  827.         done = 0;
  828.         if (diff <= 1) {
  829.            switch(UPPER(c)) {
  830. + #ifndef L_NOTOMORROW_A
  831.               case 'A':
  832. + #endif
  833. + #ifndef L_NOTOMORROW_B
  834.               case 'B':
  835. + #endif
  836. + #ifndef L_NOTOMORROW_C
  837.           case 'C':
  838. + #endif
  839. + #ifndef L_NOTOMORROW_E
  840.           case 'E':
  841. + #endif
  842. + #ifndef L_NOTOMORROW_F
  843.           case 'F':
  844. + #endif
  845. + #ifndef L_NOTOMORROW_G
  846.           case 'G':
  847. + #endif
  848. + #ifndef L_NOTOMORROW_H
  849.           case 'H':
  850. + #endif
  851. + #ifndef L_NOTOMORROW_I
  852.           case 'I':
  853. + #endif
  854. + #ifndef L_NOTOMORROW_J
  855.           case 'J':
  856. + #endif
  857. + #ifndef L_NOTOMORROW_K
  858.           case 'K':
  859. + #endif
  860. + #ifndef L_NOTOMORROW_L
  861.           case 'L':
  862. + #endif
  863. + #ifndef L_NOTOMORROW_U
  864.           case 'U':
  865. ! #endif
  866. ! #ifndef L_NOTOMORROW_V
  867. !         case 'V':
  868. ! #endif
  869. !                      sprintf(s, "%s", (diff ? TOMORROW : TODAY));
  870.                    s += strlen(s);
  871.                    done = 1;
  872.                     break;
  873. ***************
  874. *** 151,348 ****
  875.        
  876.         if (!done) switch(UPPER(c)) {
  877.            case 'A':
  878. !             sprintf(s, "on %s, %d %s, %d", DayName[jul%7], d,
  879.               MonthName[m], y);
  880.               s += strlen(s);
  881.           break;
  882.              
  883.        case 'B':
  884. !             sprintf(s, "in %d days' time", diff);
  885.           s += strlen(s);
  886.               break;
  887.              
  888.        case 'C':
  889. !         sprintf(s, "on %s", DayName[jul%7]);
  890.           s += strlen(s);
  891.           break;
  892.   
  893.        case 'D':
  894.           sprintf(s, "%d", d);
  895.           s += strlen(s);
  896.           break;
  897.   
  898.        case 'E':
  899. !         sprintf(s, "on %02d/%02d/%04d", d, m+1, y);
  900.           s += strlen(s);
  901.           break;
  902.   
  903.        case 'F':
  904. !         sprintf(s, "on %02d/%02d/%04d", m+1, d, y);
  905.           s += strlen(s);
  906.           break;
  907.   
  908.        case 'G':
  909. !         sprintf(s, "on %s, %d %s", DayName[jul%7], d, MonthName[m]);
  910.           s += strlen(s);
  911.           break;
  912.   
  913.        case 'H':
  914. !         sprintf(s, "on %02d/%02d", d, m+1);
  915.           s += strlen(s);
  916.           break;
  917.   
  918.        case 'I':
  919. !         sprintf(s, "on %02d/%02d", m+1, d);
  920.           s += strlen(s);
  921.           break;
  922.   
  923.        case 'J':
  924. !         sprintf(s, "on %s, %s %d%s, %d", DayName[jul%7],
  925.                  MonthName[m], d, plu, y);
  926.           s += strlen(s);
  927.           break;
  928.   
  929.        case 'K':
  930. !         sprintf(s, "on %s, %s %d%s", DayName[jul%7],
  931.                  MonthName[m], d, plu);
  932.           s += strlen(s);
  933.           break;
  934.   
  935.        case 'L':
  936. !         sprintf(s, "on %04d/%02d/%02d", y, m+1, d);
  937.           s += strlen(s);
  938.           break;
  939.   
  940.        case 'M':
  941.           sprintf(s, "%s", MonthName[m]);
  942.           s += strlen(s);
  943.           break;
  944.   
  945.        case 'N':
  946.           sprintf(s, "%d", m+1);
  947.           s += strlen(s);
  948.           break;
  949.   
  950.        case 'O':
  951. !         if (RealToday == JulianToday) sprintf(s, " (today)");
  952.           s += strlen(s);
  953.           break;
  954.   
  955.        case 'P':
  956. !         sprintf(s, (diff == 1 ? "" : "s"));
  957.           s += strlen(s);
  958.           break;
  959.   
  960.        case 'Q':
  961.           sprintf(s, (diff == 1 ? "'s" : "s'"));
  962.           s += strlen(s);
  963.           break;
  964.   
  965.        case 'R':
  966.           sprintf(s, "%02d", d);
  967.           s += strlen(s);
  968.           break;
  969.   
  970.        case 'S':
  971.           sprintf(s, plu);
  972.           s += strlen(s);
  973.           break;
  974.   
  975.        case 'T':
  976.           sprintf(s, "%02d", m+1);
  977.           s += strlen(s);
  978.           break;
  979.   
  980.        case 'U':
  981. !         sprintf(s, "on %s, %d%s %s, %d", DayName[jul%7], d,
  982.                  plu, MonthName[m], y);
  983.           s += strlen(s);
  984.           break;
  985.   
  986.        case 'V':
  987. !         sprintf(s, "on %s, %d%s %s", DayName[jul%7], d, plu,
  988.                  MonthName[m]);
  989.           s += strlen(s);
  990.           break;
  991.   
  992.        case 'W':
  993.           sprintf(s, DayName[jul%7]);
  994.           s += strlen(s);
  995.           break;
  996.   
  997.        case 'X':
  998.           sprintf(s, "%d", diff);
  999.           s += strlen(s);
  1000.           break;
  1001.   
  1002.        case 'Y':
  1003.           sprintf(s, "%d", y);
  1004.           s += strlen(s);
  1005.           break;
  1006.   
  1007.        case 'Z':
  1008.           sprintf(s, "%d", y % 100);
  1009.           s += strlen(s);
  1010.           break;
  1011.   
  1012.        case '1':
  1013.           if (tdiff == 0) 
  1014. !            sprintf(s, "now");
  1015.           else if (hdiff == 0) 
  1016. !            sprintf(s, "%d minute%s %s", mdiff, mplu, when);
  1017.           else if (mdiff == 0)
  1018. !            sprintf(s, "%d hour%s %s", hdiff, hplu, when);
  1019.           else
  1020. !            sprintf(s, "%d hour%s and %d minute%s %s", hdiff, hplu, mdiff, mplu, when);
  1021.           s += strlen(s);
  1022.           break;
  1023.   
  1024.        case '2':
  1025. !         sprintf(s, "at %d:%02d%s", hh, min, pm);
  1026.           s += strlen(s);
  1027.           break;
  1028.   
  1029. !      case '3': sprintf(s, "at %02d:%02d", h, min);
  1030.           s += strlen(s);
  1031.           break;
  1032.   
  1033. !      case '4': sprintf(s, "%d", tdiff);
  1034.           s += strlen(s);
  1035.           break;
  1036.   
  1037. !      case '5': sprintf(s, "%d", adiff);
  1038.           s += strlen(s);
  1039.           break;
  1040.   
  1041. !      case '6': sprintf(s, when);
  1042.           s += strlen(s);
  1043.           break;
  1044.   
  1045. !      case '7': sprintf(s, "%d", hdiff);
  1046.           s += strlen(s);
  1047.           break;
  1048.   
  1049. !      case '8': sprintf(s, "%d", mdiff);
  1050.           s += strlen(s);
  1051.           break;
  1052.   
  1053. !      case '9': sprintf(s, mplu);
  1054.           s += strlen(s);
  1055.           break;
  1056.   
  1057. !      case '0': sprintf(s, hplu);
  1058.           s += strlen(s);
  1059.           break;
  1060.   
  1061. !      case '!': sprintf(s, (tdiff >= 0 ? "is" : "was"));
  1062.           s += strlen(s);
  1063.           break;
  1064.   
  1065. !      case '@': sprintf(s, "%d:%02d%s", chh, cmin, cpm);
  1066.           s += strlen(s);
  1067.           break;
  1068.   
  1069. !      case '#': sprintf(s, "%02d:%02d", ch, cmin);
  1070.           s += strlen(s);
  1071.           break;
  1072.   
  1073. --- 182,549 ----
  1074.        
  1075.         if (!done) switch(UPPER(c)) {
  1076.            case 'A':
  1077. ! #ifdef L_A_OVER
  1078. ! L_A_OVER
  1079. ! #else     
  1080. !             sprintf(s, "%s %s, %d %s, %d", L_ON, DayName[jul%7], d,
  1081.               MonthName[m], y);
  1082. + #endif
  1083.               s += strlen(s);
  1084.           break;
  1085.              
  1086.        case 'B':
  1087. ! #ifdef L_B_OVER
  1088. ! L_B_OVER
  1089. ! #else     
  1090. !             sprintf(s, L_INXDAYS, diff);
  1091. ! #endif
  1092.           s += strlen(s);
  1093.               break;
  1094.              
  1095.        case 'C':
  1096. ! #ifdef L_C_OVER
  1097. ! L_C_OVER
  1098. ! #else     
  1099. !         sprintf(s, "%s %s", L_ON, DayName[jul%7]);
  1100. ! #endif
  1101.           s += strlen(s);
  1102.           break;
  1103.   
  1104.        case 'D':
  1105. + #ifdef L_D_OVER
  1106. + L_D_OVER
  1107. + #else     
  1108.           sprintf(s, "%d", d);
  1109. + #endif
  1110.           s += strlen(s);
  1111.           break;
  1112.   
  1113.        case 'E':
  1114. ! #ifdef L_E_OVER
  1115. ! L_E_OVER
  1116. ! #else     
  1117. !         sprintf(s, "%s %02d%c%02d%c%04d", L_ON, d, DATESEP,
  1118. !             m+1, DATESEP, y);
  1119. ! #endif
  1120.           s += strlen(s);
  1121.           break;
  1122.   
  1123.        case 'F':
  1124. ! #ifdef L_F_OVER
  1125. ! L_F_OVER
  1126. ! #else     
  1127. !         sprintf(s, "%s %02d%c%02d%c%04d", L_ON, m+1, DATESEP, d, DATESEP, y);
  1128. ! #endif
  1129.           s += strlen(s);
  1130.           break;
  1131.   
  1132.        case 'G':
  1133. ! #ifdef L_G_OVER
  1134. ! L_G_OVER
  1135. ! #else     
  1136. !         sprintf(s, "%s %s, %d %s", L_ON, DayName[jul%7], d, MonthName[m]);
  1137. ! #endif
  1138.           s += strlen(s);
  1139.           break;
  1140.   
  1141.        case 'H':
  1142. ! #ifdef L_H_OVER
  1143. ! L_H_OVER
  1144. ! #else     
  1145. !         sprintf(s, "%s %02d%c%02d", L_ON, d, DATESEP, m+1);
  1146. ! #endif
  1147.           s += strlen(s);
  1148.           break;
  1149.   
  1150.        case 'I':
  1151. ! #ifdef L_I_OVER
  1152. ! L_I_OVER
  1153. ! #else     
  1154. !         sprintf(s, "%s %02d%c%02d", L_ON, m+1, DATESEP, d);
  1155. ! #endif
  1156.           s += strlen(s);
  1157.           break;
  1158.   
  1159.        case 'J':
  1160. ! #ifdef L_J_OVER
  1161. ! L_J_OVER
  1162. ! #else
  1163. !         sprintf(s, "%s %s, %s %d%s, %d", L_ON, DayName[jul%7],
  1164.                  MonthName[m], d, plu, y);
  1165. + #endif
  1166.           s += strlen(s);
  1167.           break;
  1168.   
  1169.        case 'K':
  1170. ! #ifdef L_K_OVER
  1171. ! L_K_OVER
  1172. ! #else
  1173. !         sprintf(s, "%s %s, %s %d%s", L_ON, DayName[jul%7],
  1174.                  MonthName[m], d, plu);
  1175. + #endif
  1176.           s += strlen(s);
  1177.           break;
  1178.   
  1179.        case 'L':
  1180. ! #ifdef L_L_OVER
  1181. ! L_L_OVER
  1182. ! #else
  1183. !         sprintf(s, "%s %04d%c%02d%c%02d", L_ON, y, DATESEP, m+1, DATESEP, d);
  1184. ! #endif
  1185.           s += strlen(s);
  1186.           break;
  1187.   
  1188.        case 'M':
  1189. + #ifdef L_M_OVER
  1190. + L_M_OVER
  1191. + #else
  1192.           sprintf(s, "%s", MonthName[m]);
  1193. + #endif
  1194.           s += strlen(s);
  1195.           break;
  1196.   
  1197.        case 'N':
  1198. + #ifdef L_N_OVER
  1199. + L_N_OVER
  1200. + #else
  1201.           sprintf(s, "%d", m+1);
  1202. + #endif
  1203.           s += strlen(s);
  1204.           break;
  1205.   
  1206.        case 'O':
  1207. ! #ifdef L_O_OVER
  1208. ! L_O_OVER
  1209. ! #else
  1210. !         if (RealToday == JulianToday) sprintf(s, " (%s)", L_TODAY);
  1211. ! #endif
  1212.           s += strlen(s);
  1213.           break;
  1214.   
  1215.        case 'P':
  1216. ! #ifdef L_P_OVER
  1217. ! L_P_OVER
  1218. ! #else
  1219. !         sprintf(s, (diff == 1 ? "" : L_PLURAL));
  1220. ! #endif
  1221.           s += strlen(s);
  1222.           break;
  1223.   
  1224.        case 'Q':
  1225. + #ifdef L_Q_OVER
  1226. + L_Q_OVER
  1227. + #else
  1228.           sprintf(s, (diff == 1 ? "'s" : "s'"));
  1229. + #endif
  1230.           s += strlen(s);
  1231.           break;
  1232.   
  1233.        case 'R':
  1234. + #ifdef L_R_OVER
  1235. + L_R_OVER
  1236. + #else
  1237.           sprintf(s, "%02d", d);
  1238. + #endif
  1239.           s += strlen(s);
  1240.           break;
  1241.   
  1242.        case 'S':
  1243. + #ifdef L_S_OVER
  1244. + L_S_OVER
  1245. + #else
  1246.           sprintf(s, plu);
  1247. + #endif
  1248.           s += strlen(s);
  1249.           break;
  1250.   
  1251.        case 'T':
  1252. + #ifdef L_T_OVER
  1253. + L_T_OVER
  1254. + #else
  1255.           sprintf(s, "%02d", m+1);
  1256. + #endif
  1257.           s += strlen(s);
  1258.           break;
  1259.   
  1260.        case 'U':
  1261. ! #ifdef L_U_OVER
  1262. ! L_U_OVER
  1263. ! #else
  1264. !         sprintf(s, "%s %s, %d%s %s, %d", L_ON, DayName[jul%7], d,
  1265.                  plu, MonthName[m], y);
  1266. + #endif
  1267.           s += strlen(s);
  1268.           break;
  1269.   
  1270.        case 'V':
  1271. ! #ifdef L_V_OVER
  1272. ! L_V_OVER
  1273. ! #else
  1274. !         sprintf(s, "%s %s, %d%s %s", L_ON, DayName[jul%7], d, plu,
  1275.                  MonthName[m]);
  1276. + #endif
  1277.           s += strlen(s);
  1278.           break;
  1279.   
  1280.        case 'W':
  1281. + #ifdef L_W_OVER
  1282. + L_W_OVER
  1283. + #else
  1284.           sprintf(s, DayName[jul%7]);
  1285. + #endif
  1286.           s += strlen(s);
  1287.           break;
  1288.   
  1289.        case 'X':
  1290. + #ifdef L_X_OVER
  1291. + L_X_OVER
  1292. + #else
  1293.           sprintf(s, "%d", diff);
  1294. + #endif
  1295.           s += strlen(s);
  1296.           break;
  1297.   
  1298.        case 'Y':
  1299. + #ifdef L_Y_OVER
  1300. + L_Y_OVER
  1301. + #else
  1302.           sprintf(s, "%d", y);
  1303. + #endif
  1304.           s += strlen(s);
  1305.           break;
  1306.   
  1307.        case 'Z':
  1308. + #ifdef L_Z_OVER
  1309. + L_Z_OVER
  1310. + #else
  1311.           sprintf(s, "%d", y % 100);
  1312. + #endif
  1313.           s += strlen(s);
  1314.           break;
  1315.   
  1316.        case '1':
  1317. + #ifdef L_1_OVER
  1318. + L_1_OVER
  1319. + #else
  1320.           if (tdiff == 0) 
  1321. !            sprintf(s, L_NOW);
  1322.           else if (hdiff == 0) 
  1323. !            sprintf(s, "%d %s%s %s", mdiff, L_MINUTE, mplu, when);
  1324.           else if (mdiff == 0)
  1325. !            sprintf(s, "%d %s%s %s", hdiff, L_HOUR, hplu, when);
  1326.           else
  1327. !            sprintf(s, "%d %s%s %s %d %s%s %s", hdiff, L_HOUR, hplu,
  1328. !                                L_AND, mdiff, L_MINUTE, mplu, when);
  1329. ! #endif
  1330.           s += strlen(s);
  1331.           break;
  1332.   
  1333.        case '2':
  1334. ! #ifdef L_2_OVER
  1335. ! L_2_OVER
  1336. ! #else
  1337. !         sprintf(s, "%s %d:%02d%s", L_AT, hh, min, pm);
  1338. ! #endif
  1339.           s += strlen(s);
  1340.           break;
  1341.   
  1342. !      case '3':
  1343. ! #ifdef L_3_OVER
  1344. ! L_3_OVER
  1345. ! #else
  1346. !         sprintf(s, "%s %02d:%02d", L_AT, h, min);
  1347. ! #endif
  1348.           s += strlen(s);
  1349.           break;
  1350.   
  1351. !      case '4':
  1352. ! #ifdef L_4_OVER
  1353. ! L_4_OVER
  1354. ! #else
  1355. !         sprintf(s, "%d", tdiff);
  1356. ! #endif
  1357.           s += strlen(s);
  1358.           break;
  1359.   
  1360. !      case '5':
  1361. ! #ifdef L_5_OVER
  1362. ! L_5_OVER
  1363. ! #else
  1364. !         sprintf(s, "%d", adiff);
  1365. ! #endif
  1366.           s += strlen(s);
  1367.           break;
  1368.   
  1369. !      case '6':
  1370. ! #ifdef L_6_OVER
  1371. ! L_6_OVER
  1372. ! #else
  1373. !         sprintf(s, when);
  1374. ! #endif
  1375.           s += strlen(s);
  1376.           break;
  1377.   
  1378. !      case '7':
  1379. ! #ifdef L_7_OVER
  1380. ! L_7_OVER
  1381. ! #else
  1382. !         sprintf(s, "%d", hdiff);
  1383. ! #endif
  1384.           s += strlen(s);
  1385.           break;
  1386.   
  1387. !      case '8':
  1388. ! #ifdef L_8_OVER
  1389. ! L_8_OVER
  1390. ! #else
  1391. !         sprintf(s, "%d", mdiff);
  1392. ! #endif
  1393.           s += strlen(s);
  1394.           break;
  1395.   
  1396. !      case '9':
  1397. ! #ifdef L_9_OVER
  1398. ! L_9_OVER
  1399. ! #else
  1400. !         sprintf(s, mplu);
  1401. ! #endif
  1402.           s += strlen(s);
  1403.           break;
  1404.   
  1405. !      case '0':
  1406. ! #ifdef L_0_OVER
  1407. ! L_0_OVER
  1408. ! #else
  1409. !         sprintf(s, hplu);
  1410. ! #endif
  1411.           s += strlen(s);
  1412.           break;
  1413.   
  1414. !      case '!':
  1415. ! #ifdef L_BANG_OVER
  1416. ! L_BANG_OVER
  1417. ! #else
  1418. !         sprintf(s, (tdiff >= 0 ? L_IS : L_WAS));
  1419. ! #endif
  1420.           s += strlen(s);
  1421.           break;
  1422.   
  1423. !      case '@':
  1424. ! #ifdef L_AT_OVER
  1425. ! L_AT_OVER
  1426. ! #else
  1427. !         sprintf(s, "%d:%02d%s", chh, cmin, cpm);
  1428. ! #endif
  1429.           s += strlen(s);
  1430.           break;
  1431.   
  1432. !      case '#':
  1433. ! #ifdef L_HASH_OVER
  1434. ! L_HASH_OVER
  1435. ! #else
  1436. !         sprintf(s, "%02d:%02d", ch, cmin);
  1437. ! #endif
  1438.           s += strlen(s);
  1439.           break;
  1440.   
  1441. *** ../patch1/err.h    Wed Dec 16 10:51:24 1992
  1442. --- ./err.h    Fri Jan  8 13:25:56 1993
  1443. ***************
  1444. *** 5,11 ****
  1445.   /*  Error definitions.                                         */
  1446.   /*                                                             */
  1447.   /*  This file is part of REMIND.                               */
  1448. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  1449.   /*                                                             */
  1450.   /***************************************************************/
  1451.   
  1452. --- 5,11 ----
  1453.   /*  Error definitions.                                         */
  1454.   /*                                                             */
  1455.   /*  This file is part of REMIND.                               */
  1456. ! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  1457.   /*                                                             */
  1458.   /***************************************************************/
  1459.   
  1460. *** ../patch1/expr.c    Wed Dec 16 10:51:32 1992
  1461. --- ./expr.c    Fri Jan 22 10:23:16 1993
  1462. ***************
  1463. *** 5,11 ****
  1464.   /*  This file contains routines to parse and evaluate          */
  1465.   /*  expressions.                                               */
  1466.   /*                                                             */
  1467. ! /*  Copyright 1992 by David F. Skoll.                          */
  1468.   /*                                                             */
  1469.   /***************************************************************/
  1470.   
  1471. --- 5,11 ----
  1472.   /*  This file contains routines to parse and evaluate          */
  1473.   /*  expressions.                                               */
  1474.   /*                                                             */
  1475. ! /*  Copyright 1992, 1993 by David F. Skoll.                    */
  1476.   /*                                                             */
  1477.   /***************************************************************/
  1478.   
  1479. ***************
  1480. *** 604,610 ****
  1481.               case TIM_TYPE: sprintf(CoerceBuf, "%02d:%02d", v->v.val / 60, v->v.val % 60);
  1482.                  break;
  1483.           case DATE_TYPE: FromJulian(v->v.val, &y, &m, &d);
  1484. !                 sprintf(CoerceBuf, "%04d/%02d/%02d", y, m+1, d);
  1485.                   break;
  1486.               default: return E_CANT_COERCE;
  1487.            }
  1488. --- 604,611 ----
  1489.               case TIM_TYPE: sprintf(CoerceBuf, "%02d:%02d", v->v.val / 60, v->v.val % 60);
  1490.                  break;
  1491.           case DATE_TYPE: FromJulian(v->v.val, &y, &m, &d);
  1492. !                 sprintf(CoerceBuf, "%04d%c%02d%c%02d",
  1493. !                     y, DATESEP, m+1, DATESEP, d);
  1494.                   break;
  1495.               default: return E_CANT_COERCE;
  1496.            }
  1497. ***************
  1498. *** 1176,1182 ****
  1499.      else if (v->type == TIM_TYPE) fprintf(fp, "%02d:%02d", v->v.val / 60, v->v.val % 60);
  1500.      else if (v->type == DATE_TYPE) {
  1501.         FromJulian(v->v.val, &y, &m, &d);
  1502. !       fprintf(fp, "%04d/%02d/%02d", y, m+1, d);
  1503.      }
  1504.      else fprintf(fp, "ERR");
  1505.   }
  1506. --- 1177,1183 ----
  1507.      else if (v->type == TIM_TYPE) fprintf(fp, "%02d:%02d", v->v.val / 60, v->v.val % 60);
  1508.      else if (v->type == DATE_TYPE) {
  1509.         FromJulian(v->v.val, &y, &m, &d);
  1510. !       fprintf(fp, "%04d%c%02d%c%02d", y, DATESEP, m+1, DATESEP, d);
  1511.      }
  1512.      else fprintf(fp, "ERR");
  1513.   }
  1514. ***************
  1515. *** 1233,1239 ****
  1516.         y *= 10;
  1517.         y += *(*s)++ - '0';
  1518.      }
  1519. !    if (*(*s)++ != '/') return E_BAD_DATE;
  1520.      if (!isdigit(**s)) return E_BAD_DATE;
  1521.      while (isdigit(**s)) {
  1522.         m *= 10;
  1523. --- 1234,1241 ----
  1524.         y *= 10;
  1525.         y += *(*s)++ - '0';
  1526.      }
  1527. !    if (**s != '/' && **s != '-') return E_BAD_DATE;
  1528. !    (*s)++;
  1529.      if (!isdigit(**s)) return E_BAD_DATE;
  1530.      while (isdigit(**s)) {
  1531.         m *= 10;
  1532. ***************
  1533. *** 1240,1246 ****
  1534.         m += *(*s)++ - '0';
  1535.      }
  1536.      m--;
  1537. !    if (*(*s)++ != '/') return E_BAD_DATE;
  1538.      if (!isdigit(**s)) return E_BAD_DATE;
  1539.      while (isdigit(**s)) {
  1540.         d *= 10;
  1541. --- 1242,1249 ----
  1542.         m += *(*s)++ - '0';
  1543.      }
  1544.      m--;
  1545. !    if (**s != '/' && **s != '-') return E_BAD_DATE;
  1546. !    (*s)++;
  1547.      if (!isdigit(**s)) return E_BAD_DATE;
  1548.      while (isdigit(**s)) {
  1549.         d *= 10;
  1550. *** ../patch1/expr.h    Wed Dec 16 10:51:24 1992
  1551. --- ./expr.h    Fri Jan  8 13:25:45 1993
  1552. ***************
  1553. *** 5,11 ****
  1554.   /*  Contains a few definitions used by expression evaluator.   */
  1555.   /*                                                             */
  1556.   /*  This file is part of REMIND.                               */
  1557. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  1558.   /*                                                             */
  1559.   /***************************************************************/
  1560.   
  1561. --- 5,11 ----
  1562.   /*  Contains a few definitions used by expression evaluator.   */
  1563.   /*                                                             */
  1564.   /*  This file is part of REMIND.                               */
  1565. ! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  1566.   /*                                                             */
  1567.   /***************************************************************/
  1568.   
  1569. *** ../patch1/files.c    Wed Dec 16 10:51:33 1992
  1570. --- ./files.c    Fri Jan  8 13:25:39 1993
  1571. ***************
  1572. *** 7,13 ****
  1573.   /*  files.                                                     */
  1574.   /*                                                             */
  1575.   /*  This file is part of REMIND.                               */
  1576. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  1577.   /*                                                             */
  1578.   /***************************************************************/
  1579.   
  1580. --- 7,13 ----
  1581.   /*  files.                                                     */
  1582.   /*                                                             */
  1583.   /*  This file is part of REMIND.                               */
  1584. ! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  1585.   /*                                                             */
  1586.   /***************************************************************/
  1587.   
  1588. *** ../patch1/funcs.c    Wed Dec 16 10:51:34 1992
  1589. --- ./funcs.c    Fri Jan 22 10:03:07 1993
  1590. ***************
  1591. *** 6,12 ****
  1592.   /*  expressions.                                               */
  1593.   /*                                                             */
  1594.   /*  This file is part of REMIND.                               */
  1595. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  1596.   /*                                                             */
  1597.   /***************************************************************/
  1598.   #include "config.h"
  1599. --- 6,12 ----
  1600.   /*  expressions.                                               */
  1601.   /*                                                             */
  1602.   /*  This file is part of REMIND.                               */
  1603. ! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  1604.   /*                                                             */
  1605.   /***************************************************************/
  1606.   #include "config.h"
  1607. ***************
  1608. *** 62,67 ****
  1609. --- 62,68 ----
  1610.   PRIVATE    int    FIif        ARGS ((void));
  1611.   PRIVATE    int    FIndex        ARGS ((void));
  1612.   PRIVATE    int    FIsomitted    ARGS ((void));
  1613. + PRIVATE    int    FLanguage    ARGS ((void));
  1614.   PRIVATE    int    FMax        ARGS ((void));
  1615.   PRIVATE    int    FMin        ARGS ((void));
  1616.   PRIVATE    int    FMinute        ARGS ((void));
  1617. ***************
  1618. *** 151,156 ****
  1619. --- 152,158 ----
  1620.       {   "index",    2,    3,    FIndex     },
  1621.       {   "isleap",    1,    1,    FIsleap },
  1622.       {   "isomitted",    1,    1,    FIsomitted },
  1623. +     {   "language",     0,      0,      FLanguage },
  1624.       {   "lower",    1,    1,    FLower    },
  1625.       {   "max",        1,    NO_MAX,    FMax    },
  1626.       {   "min",        1,    NO_MAX, FMin    },
  1627. ***************
  1628. *** 1416,1419 ****
  1629. --- 1418,1437 ----
  1630.         case STR_TYPE:  return RetStrVal("STRING");
  1631.         default:        return RetStrVal("ERR");
  1632.      }
  1633. + }
  1634. + /***************************************************************/
  1635. + /*                                                             */
  1636. + /*  FLanguage                                                  */
  1637. + /*                                                             */
  1638. + /*  Implement the language() function.                         */
  1639. + /*                                                             */
  1640. + /***************************************************************/
  1641. + #ifdef HAVE_PROTOS
  1642. + PRIVATE int FLanguage(void)
  1643. + #else
  1644. + static int FLanguage()
  1645. + #endif
  1646. + {
  1647. +    return RetStrVal(L_LANGNAME);
  1648.   }
  1649. *** ../patch1/globals.c    Wed Dec 16 10:51:34 1992
  1650. --- ./globals.c    Thu Jan 21 16:50:15 1993
  1651. ***************
  1652. *** 8,14 ****
  1653.   /*  globals.h and err.h                                        */
  1654.   /*                                                             */
  1655.   /*  This file is part of REMIND.                               */
  1656. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  1657.   /*                                                             */
  1658.   /***************************************************************/
  1659.   #include "config.h"
  1660. --- 8,14 ----
  1661.   /*  globals.h and err.h                                        */
  1662.   /*                                                             */
  1663.   /*  This file is part of REMIND.                               */
  1664. ! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  1665.   /*                                                             */
  1666.   /***************************************************************/
  1667.   #include "config.h"
  1668. *** ../patch1/globals.h    Wed Dec 16 10:51:25 1992
  1669. --- ./globals.h    Thu Jan 21 16:02:55 1993
  1670. ***************
  1671. *** 7,16 ****
  1672.   /*  MK_GLOBALS.  Also contains useful macro definitions.       */
  1673.   /*                                                             */
  1674.   /*  This file is part of REMIND.                               */
  1675. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  1676.   /*                                                             */
  1677.   /***************************************************************/
  1678.   #ifdef MK_GLOBALS
  1679.   #undef EXTERN
  1680.   #define EXTERN
  1681. --- 7,16 ----
  1682.   /*  MK_GLOBALS.  Also contains useful macro definitions.       */
  1683.   /*                                                             */
  1684.   /*  This file is part of REMIND.                               */
  1685. ! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  1686.   /*                                                             */
  1687.   /***************************************************************/
  1688. ! #include "lang.h"
  1689.   #ifdef MK_GLOBALS
  1690.   #undef EXTERN
  1691.   #define EXTERN
  1692. ***************
  1693. *** 49,55 ****
  1694.   EXTERN  INIT(    char    InfiniteDelta, 0);
  1695.   EXTERN  INIT(   char    RunDisabled, 0);
  1696.   EXTERN  INIT(   char    IgnoreOnce, 0);
  1697. ! EXTERN  INIT(   char    Banner[LINELEN], "Reminders for %w, %d%s %m, %y%o:");
  1698.   EXTERN    char    *InitialFile;
  1699.   EXTERN    int    FileAccessDate;
  1700.   
  1701. --- 49,55 ----
  1702.   EXTERN  INIT(    char    InfiniteDelta, 0);
  1703.   EXTERN  INIT(   char    RunDisabled, 0);
  1704.   EXTERN  INIT(   char    IgnoreOnce, 0);
  1705. ! EXTERN  INIT(   char    Banner[LINELEN], L_BANNER);
  1706.   EXTERN    char    *InitialFile;
  1707.   EXTERN    int    FileAccessDate;
  1708.   
  1709. ***************
  1710. *** 76,94 ****
  1711.   EXTERN  INIT(   int     NumTriggered, 0);
  1712.   EXTERN  int ArgC;
  1713.   EXTERN  char **ArgV;
  1714.   
  1715.   /* List of months */
  1716.   EXTERN    char    *MonthName[]
  1717.   #ifdef MK_GLOBALS
  1718. ! = {"January", "February", "March", "April", "May", "June",
  1719. !    "July", "August", "September", "October", "November", "December" }
  1720.   #endif
  1721.   ;
  1722.   
  1723.   EXTERN    char    *DayName[]
  1724.   #ifdef MK_GLOBALS
  1725. ! = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday",
  1726. !    "Sunday"}
  1727.   #endif
  1728.   ;
  1729.   
  1730. --- 76,96 ----
  1731.   EXTERN  INIT(   int     NumTriggered, 0);
  1732.   EXTERN  int ArgC;
  1733.   EXTERN  char **ArgV;
  1734. + EXTERN  INIT(   int     CalLines, CAL_LINES);
  1735. + EXTERN  INIT(   int     CalPad, 1);
  1736.   
  1737.   /* List of months */
  1738.   EXTERN    char    *MonthName[]
  1739.   #ifdef MK_GLOBALS
  1740. ! = {L_JAN, L_FEB, L_MAR, L_APR, L_MAY, L_JUN,
  1741. !    L_JUL, L_AUG, L_SEP, L_OCT, L_NOV, L_DEC}
  1742.   #endif
  1743.   ;
  1744.   
  1745.   EXTERN    char    *DayName[]
  1746.   #ifdef MK_GLOBALS
  1747. ! = {L_MONDAY, L_TUESDAY, L_WEDNESDAY, L_THURSDAY, L_FRIDAY,
  1748. !    L_SATURDAY, L_SUNDAY}
  1749.   #endif
  1750.   ;
  1751.   
  1752. *** ../patch1/init.c    Wed Dec 16 10:51:35 1992
  1753. --- ./init.c    Mon Feb  1 15:47:17 1993
  1754. ***************
  1755. *** 7,13 ****
  1756.   /*  in normal mode.                                            */
  1757.   /*                                                             */
  1758.   /*  This file is part of REMIND.                               */
  1759. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  1760.   /*                                                             */
  1761.   /***************************************************************/
  1762.   #include "config.h"
  1763. --- 7,13 ----
  1764.   /*  in normal mode.                                            */
  1765.   /*                                                             */
  1766.   /*  This file is part of REMIND.                               */
  1767. ! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  1768.   /*                                                             */
  1769.   /***************************************************************/
  1770.   #include "config.h"
  1771. ***************
  1772. *** 18,23 ****
  1773. --- 18,27 ----
  1774.   #ifdef HAVE_MALLOC_H
  1775.   #include <malloc.h>
  1776.   #endif
  1777. + #ifdef UNIX
  1778. + #include <sys/types.h>
  1779. + #include <pwd.h>
  1780. + #endif
  1781.   #include <ctype.h>
  1782.   #include "types.h"
  1783.   #include "protos.h"
  1784. ***************
  1785. *** 34,40 ****
  1786.    *             simple calendar format.
  1787.    *  -r       = Disallow RUN mode
  1788.    *  -c[n]    = Produce a calendar for n months (default = 1)
  1789. !  *  -w[n]    = Specify output device width (default = 80)
  1790.    *  -s[n]    = Produce calendar in "simple calendar" format
  1791.    *  -p[n]    = Produce calendar in format compatible with rem2ps
  1792.    *  -v       = Verbose mode
  1793. --- 38,44 ----
  1794.    *             simple calendar format.
  1795.    *  -r       = Disallow RUN mode
  1796.    *  -c[n]    = Produce a calendar for n months (default = 1)
  1797. !  *  -w[n,n,n] = Specify output device width, padding and spacing
  1798.    *  -s[n]    = Produce calendar in "simple calendar" format
  1799.    *  -p[n]    = Produce calendar in format compatible with rem2ps
  1800.    *  -v       = Verbose mode
  1801. ***************
  1802. *** 54,59 ****
  1803. --- 58,64 ----
  1804.    *  -z[n]    = Daemon mode waking up every n (def 5) minutes.
  1805.    *  -bn      = Time format for cal (0, 1, or 2)
  1806.    *  -xn      = Max. number of iterations for SATISFY
  1807. +  *  -uname   = Run as user 'name' - only valid when run by root.
  1808.    *
  1809.    **************************************************************/
  1810.   
  1811. ***************
  1812. *** 66,71 ****
  1813. --- 71,80 ----
  1814.         s++;                 \
  1815.      }
  1816.   
  1817. + #ifdef UNIX
  1818. + PRIVATE void ChgUser ARGS((char *uname));
  1819. + #endif
  1820.   static char *BadDate = "Illegal date on command line\n";
  1821.   
  1822.   /***************************************************************/
  1823. ***************
  1824. *** 144,149 ****
  1825. --- 153,166 ----
  1826.              Hush = 1;
  1827.              break;
  1828.   
  1829. + #if defined(UNIX) && defined(WANT_U_OPTION)
  1830. +         case 'u':
  1831. +         case 'U':
  1832. +            ChgUser(arg);
  1833. +            while (*arg) arg++;
  1834. +            break;
  1835. + #endif           
  1836.   #ifdef HAVE_QUEUED
  1837.           case 'z':
  1838.           case 'Z':
  1839. ***************
  1840. *** 198,205 ****
  1841.   
  1842.           case 'w':
  1843.           case 'W':
  1844. !            PARSENUM(CalWidth, arg);
  1845. !            if (CalWidth < 80) CalWidth = 80;
  1846.              break;
  1847.   
  1848.           case 'd':
  1849. --- 215,236 ----
  1850.   
  1851.           case 'w':
  1852.           case 'W':
  1853. !            if (*arg != ',') {
  1854. !               PARSENUM(CalWidth, arg);
  1855. !               if (CalWidth < 80) CalWidth = 80;
  1856. !            }
  1857. !            if (*arg == ',') {
  1858. !               arg++;
  1859. !           if (*arg != ',') {
  1860. !                 PARSENUM(CalLines, arg);
  1861. !              if (CalLines > 20) CalLines = 20;
  1862. !           }
  1863. !           if (*arg == ',') {
  1864. !              arg++;
  1865. !              PARSENUM(CalPad, arg);
  1866. !              if (CalPad > 20) CalPad = 20;
  1867. !           }
  1868. !            }
  1869.              break;
  1870.   
  1871.           case 'd':
  1872. ***************
  1873. *** 311,317 ****
  1874.   void Usage()
  1875.   #endif
  1876.   {
  1877. !    fprintf(ErrFp, "\nREMIND %s Copyright 1992 by David F. Skoll\n\n", VERSION);
  1878.      fprintf(ErrFp, "        Usage: remind [options] filename [date]\n");
  1879.      fprintf(ErrFp, "Options:\n");
  1880.      fprintf(ErrFp, " -n     Output next occurrence of reminders in simple format\n");
  1881. --- 342,348 ----
  1882.   void Usage()
  1883.   #endif
  1884.   {
  1885. !    fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992, 1993 by David F. Skoll\n\n", VERSION, L_LANGNAME);
  1886.      fprintf(ErrFp, "        Usage: remind [options] filename [date]\n");
  1887.      fprintf(ErrFp, "Options:\n");
  1888.      fprintf(ErrFp, " -n     Output next occurrence of reminders in simple format\n");
  1889. ***************
  1890. *** 318,324 ****
  1891.      fprintf(ErrFp, " -r     Disable RUN directives\n");
  1892.      fprintf(ErrFp, " -c[n]  Produce a calendar for n (default 1) months\n");
  1893.      fprintf(ErrFp, " -c+[n] Produce a calendar for n (default 1) weeks\n");
  1894. !    fprintf(ErrFp, " -w[n]  Specify width (default 80) of calendar output\n");
  1895.      fprintf(ErrFp, " -s[n]  Produce 'simple calendar' for n (1) months\n");
  1896.      fprintf(ErrFp, " -p[n]  Same as -s, but input compatible with rem2ps\n");
  1897.      fprintf(ErrFp, " -v     Verbose mode\n");
  1898. --- 349,355 ----
  1899.      fprintf(ErrFp, " -r     Disable RUN directives\n");
  1900.      fprintf(ErrFp, " -c[n]  Produce a calendar for n (default 1) months\n");
  1901.      fprintf(ErrFp, " -c+[n] Produce a calendar for n (default 1) weeks\n");
  1902. !    fprintf(ErrFp, " -w[n[,p[,s]]]  Specify width, padding and spacing of calendar\n");
  1903.      fprintf(ErrFp, " -s[n]  Produce 'simple calendar' for n (1) months\n");
  1904.      fprintf(ErrFp, " -p[n]  Same as -s, but input compatible with rem2ps\n");
  1905.      fprintf(ErrFp, " -v     Verbose mode\n");
  1906. ***************
  1907. *** 337,339 ****
  1908. --- 368,450 ----
  1909.      fprintf(ErrFp, " -x[n]  Iteration limit for SATISFY clause (def=150)\n");
  1910.      exit(1);
  1911.   }
  1912. + /***************************************************************/
  1913. + /*                                                             */
  1914. + /*  ChgUser                                                    */
  1915. + /*                                                             */
  1916. + /*  Run as a specified user.  Can only be used if Remind is    */
  1917. + /*  started by root.  This changes the real and effective uid, */
  1918. + /*  the real and effective gid, and sets the HOME, SHELL and   */
  1919. + /*  USER environment variables.                                */
  1920. + /*                                                             */
  1921. + /***************************************************************/
  1922. + #if defined(UNIX) && defined(WANT_U_OPTION)
  1923. + #ifdef HAVE_PROTOS
  1924. + PRIVATE void ChgUser(char *user)
  1925. + #else
  1926. + static void ChgUser(user)
  1927. + char *user;
  1928. + #endif /* HAVE_PROTOS */
  1929. + {
  1930. + #ifdef SYSV
  1931. +    uid_t myuid;
  1932. + #else
  1933. +    int myuid;
  1934. + #endif
  1935. +    static char *NoEnvMem = "Remind: Out of memory for environment\n";
  1936. +    struct passwd *pwent;
  1937. +    static char *home, *shell, *username;
  1938. +    myuid = getuid();
  1939. +    if (myuid) {
  1940. +       fprintf(ErrFp, "Remind: Only the super-user can use the '-u' option.\n");
  1941. +       exit(1);
  1942. +    }
  1943. +    pwent = getpwnam(user);
  1944. +    if (!pwent) {
  1945. +       fprintf(ErrFp, "Remind: Unknown user '%s'\n", user);
  1946. +       exit(1);
  1947. +    }
  1948. +    if (setgid(pwent->pw_gid)) {
  1949. +       fprintf(ErrFp, "Remind: Could not change gid to %d\n", pwent->pw_gid);
  1950. +       exit(1);
  1951. +    }
  1952. +    if (setuid(pwent->pw_uid)) {
  1953. +       fprintf(ErrFp, "Remind: Could not change uid to %d\n", pwent->pw_uid);
  1954. +       exit(1);
  1955. +    }
  1956. +    home = malloc(strlen(pwent->pw_dir) + 6);
  1957. +    if (!home) {
  1958. +       fprintf(ErrFp, NoEnvMem);
  1959. +       exit(1);
  1960. +    }
  1961. +    sprintf(home, "HOME=%s", pwent->pw_dir);
  1962. +    putenv(home);
  1963. +    shell = malloc(strlen(pwent->pw_dir) + 7);
  1964. +    if (!shell) {
  1965. +       fprintf(ErrFp, NoEnvMem);
  1966. +       exit(1);
  1967. +    }
  1968. +    sprintf(shell, "SHELL=%s", pwent->pw_shell);
  1969. +    putenv(shell);
  1970. +    if (pwent->pw_uid) {
  1971. +       username = malloc(strlen(pwent->pw_dir) + 6);
  1972. +       if (!username) {
  1973. +          fprintf(ErrFp, NoEnvMem);
  1974. +          exit(1);
  1975. +       }
  1976. +       sprintf(username, "USER=%s", pwent->pw_dir);
  1977. +       putenv(username);
  1978. +    }
  1979. + }
  1980. + #endif /* UNIX && WANT_U_OPTION */
  1981. +    
  1982.