home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / mail / elm / 3942 < prev    next >
Encoding:
Internet Message Format  |  1993-01-05  |  72.3 KB

  1. Xref: sparky comp.mail.elm:3942 comp.sources.bugs:321
  2. Path: sparky!uunet!spool.mu.edu!dsinc!dsinc!not-for-mail
  3. From: syd@dsinc.DSI.COM (Syd Weinstein)
  4. Newsgroups: comp.mail.elm,comp.sources.bugs
  5. Subject: elm 2.4 Patch #20
  6. Followup-To: poster
  7. Date: 5 Jan 1993 13:08:21 -0500
  8. Organization: Datacomp Systems, Inc., Huntingdon Valley, PA 19006
  9. Lines: 2364
  10. Sender: syd@dsi.com
  11. Message-ID: <1iciqlINN20l@dsinc.dsi.com>
  12. NNTP-Posting-Host: dsinc.dsi.com
  13. Summary: This is an official patch for elm 2.4 system.  Please apply it.
  14. Priority: LOW
  15.  
  16. Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your elm source
  17.     directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
  18.     If you don't have the patch program, apply the following by hand,
  19.     or get patch (version 2.0, latest patchlevel).
  20.  
  21.     After patching:
  22.         sh Configure -d
  23.         make
  24.         make install
  25.  
  26.     If patch indicates that patchlevel is the wrong version, you may need
  27.     to apply one or more previous patches, or the patch may already
  28.     have been applied.  See the patchlevel.h file to find out what has or
  29.     has not been applied.  In any event, don't continue with the patch.
  30.  
  31.     If you are missing previous patches they can be obtained from our:
  32.     archive server.
  33.  
  34.     Syd Weinstein
  35.     elm@DSI.COM
  36.  
  37.     The patches are available from the dsinc archive server
  38.     Send the following message to archive-server@DSI.COM for
  39.     a list of available patches:
  40.  
  41.     Subject: patch list
  42.     send index elm
  43.  
  44. Index: hdrs/patchlevel.h
  45. Prereq: "19"
  46. *** ../elm2.4/hdrs/patchlevel.h    Thu Dec 24 18:56:58 1992
  47. --- hdrs/patchlevel.h    Thu Dec 24 18:57:39 1992
  48. ***************
  49. *** 1 ****
  50. ! #define PATCHLEVEL "19"
  51. --- 1 ----
  52. ! #define PATCHLEVEL "20"
  53.  
  54. Index: src/elm.c
  55. Prereq: 5.8
  56. *** ../elm2.4/src/elm.c    Thu Dec 24 18:56:50 1992
  57. --- src/elm.c    Thu Dec 24 16:42:08 1992
  58. ***************
  59. *** 1,8 ****
  60.   
  61. ! static char rcsid[] = "@(#)$Id: elm.c,v 5.8 1992/12/11 01:45:04 syd Exp $";
  62.   
  63.   /*******************************************************************************
  64. !  *  The Elm Mail System  -  $Revision: 5.8 $   $State: Exp $
  65.    *
  66.    * This file and all associated files and documentation:
  67.    *            Copyright (c) 1988-1992 USENET Community Trust
  68. --- 1,8 ----
  69.   
  70. ! static char rcsid[] = "@(#)$Id: elm.c,v 5.10 1992/12/24 21:42:01 syd Exp $";
  71.   
  72.   /*******************************************************************************
  73. !  *  The Elm Mail System  -  $Revision: 5.10 $   $State: Exp $
  74.    *
  75.    * This file and all associated files and documentation:
  76.    *            Copyright (c) 1988-1992 USENET Community Trust
  77. ***************
  78. *** 15,20 ****
  79. --- 15,29 ----
  80.    *
  81.    *******************************************************************************
  82.    * $Log: elm.c,v $
  83. +  * Revision 5.10  1992/12/24  21:42:01  syd
  84. +  * Fix messages and nls messages to match.  Plus use want_to
  85. +  * where appropriate.
  86. +  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
  87. +  *
  88. +  * Revision 5.9  1992/12/16  14:33:25  syd
  89. +  * add back missing nl on check only output
  90. +  * From: Syd
  91. +  *
  92.    * Revision 5.8  1992/12/11  01:45:04  syd
  93.    * remove sys/types.h include, it is now included by defs.h
  94.    * and this routine includes defs.h or indirectly includes defs.h
  95. ***************
  96. *** 724,730 ****
  97.         "Expands to: ");
  98.       printf(msg);
  99.   
  100. !     printf("%s", format_long(buffer, strlen(msg)));
  101.       }
  102.   
  103.   check_range()
  104. --- 733,739 ----
  105.         "Expands to: ");
  106.       printf(msg);
  107.   
  108. !     printf("%s\n", format_long(buffer, strlen(msg)));
  109.       }
  110.   
  111.   check_range()
  112. ***************
  113. *** 783,789 ****
  114.           case '/'    :  /* scan mbox or aliases for string */
  115.                  if  (message_count < 1) {
  116.                    error1(catgets(elm_msg_cat, ElmSet,
  117. !                 ElmNoMailToScan, "No %s to scan!"), items);
  118.                    fflush(stdin);
  119.                  }
  120.                  else if (pattern_match())
  121. --- 792,798 ----
  122.           case '/'    :  /* scan mbox or aliases for string */
  123.                  if  (message_count < 1) {
  124.                    error1(catgets(elm_msg_cat, ElmSet,
  125. !                 ElmNoItemToScan, "No %s to scan!"), items);
  126.                    fflush(stdin);
  127.                  }
  128.                  else if (pattern_match())
  129.  
  130. Index: src/exitprog.c
  131. Prereq: 5.1
  132. *** ../elm2.4/src/exitprog.c    Sat Oct  3 18:58:52 1992
  133. --- src/exitprog.c    Thu Dec 24 19:27:00 1992
  134. ***************
  135. *** 1,8 ****
  136.   
  137. ! static char rcsid[] = "@(#)$Id: exitprog.c,v 5.1 1992/10/03 22:58:40 syd Exp $";
  138.   
  139.   /*******************************************************************************
  140. !  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
  141.    *
  142.    *            Copyright (c) 1988-1992 USENET Community Trust
  143.    *            Copyright (c) 1986,1987 Dave Taylor
  144. --- 1,8 ----
  145.   
  146. ! static char rcsid[] = "@(#)$Id: exitprog.c,v 5.3 1992/12/25 00:26:49 syd Exp $";
  147.   
  148.   /*******************************************************************************
  149. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  150.    *
  151.    *            Copyright (c) 1988-1992 USENET Community Trust
  152.    *            Copyright (c) 1986,1987 Dave Taylor
  153. ***************
  154. *** 14,19 ****
  155. --- 14,28 ----
  156.    *
  157.    *******************************************************************************
  158.    * $Log: exitprog.c,v $
  159. +  * Revision 5.3  1992/12/25  00:26:49  syd
  160. +  * Fix routine names
  161. +  * From: Syd
  162. +  *
  163. +  * Revision 5.2  1992/12/24  21:42:01  syd
  164. +  * Fix messages and nls messages to match.  Plus use want_to
  165. +  * where appropriate.
  166. +  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
  167. +  *
  168.    * Revision 5.1  1992/10/03  22:58:40  syd
  169.    * Initial checkin as of 2.4 Release at PL0
  170.    *
  171. ***************
  172. *** 49,62 ****
  173.           softkeys_on();
  174.         }
  175.         if (changes == 1)
  176. !         msg = catgets(elm_msg_cat, ElmSet, ElmAbandonChange,
  177. !         "Abandon change to mailbox? (y/n) ");
  178.         else
  179. !         msg = catgets(elm_msg_cat, ElmSet, ElmAbandonChangePlural,
  180. !         "Abandon changes to mailbox? (y/n) ");
  181. !       answer = want_to(msg, 'n');
  182.   
  183. !       if(answer != 'y') return -1;
  184.       }
  185.   
  186.       fflush(stdout);
  187. --- 58,71 ----
  188.           softkeys_on();
  189.         }
  190.         if (changes == 1)
  191. !         MCsprintf(msg, catgets(elm_msg_cat, ElmSet, ElmAbandonChange,
  192. !         "Abandon change to mailbox? (%c/%c) "), *def_ans_yes, *def_ans_no);
  193.         else
  194. !         MCsprintf(msg, catgets(elm_msg_cat, ElmSet, ElmAbandonChangePlural,
  195. !         "Abandon changes to mailbox? (%c/%c) "), *def_ans_yes, *def_ans_no);
  196. !       answer = want_to(msg, *def_ans_no, LINES-3);
  197.   
  198. !       if(answer != *def_ans_yes) return -1;
  199.       }
  200.   
  201.       fflush(stdout);
  202.  
  203. Index: src/file.c
  204. Prereq: 5.7
  205. *** ../elm2.4/src/file.c    Thu Dec 24 18:56:51 1992
  206. --- src/file.c    Thu Dec 24 19:20:39 1992
  207. ***************
  208. *** 1,8 ****
  209.   
  210. ! static char rcsid[] = "@(#)$Id: file.c,v 5.7 1992/12/07 02:38:45 syd Exp $";
  211.   
  212.   /*******************************************************************************
  213. !  *  The Elm Mail System  -  $Revision: 5.7 $   $State: Exp $
  214.    *
  215.    *            Copyright (c) 1988-1992 USENET Community Trust
  216.    *            Copyright (c) 1986,1987 Dave Taylor
  217. --- 1,8 ----
  218.   
  219. ! static char rcsid[] = "@(#)$Id: file.c,v 5.9 1992/12/25 00:20:32 syd Exp $";
  220.   
  221.   /*******************************************************************************
  222. !  *  The Elm Mail System  -  $Revision: 5.9 $   $State: Exp $
  223.    *
  224.    *            Copyright (c) 1988-1992 USENET Community Trust
  225.    *            Copyright (c) 1986,1987 Dave Taylor
  226. ***************
  227. *** 14,19 ****
  228. --- 14,28 ----
  229.    *
  230.    *******************************************************************************
  231.    * $Log: file.c,v $
  232. +  * Revision 5.9  1992/12/25  00:20:32  syd
  233. +  * fix variable name
  234. +  * From: Syd
  235. +  *
  236. +  * Revision 5.8  1992/12/24  21:42:01  syd
  237. +  * Fix messages and nls messages to match.  Plus use want_to
  238. +  * where appropriate.
  239. +  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
  240. +  *
  241.    * Revision 5.7  1992/12/07  02:38:45  syd
  242.    * When ELM is reporting "appending to <foldername>" I never get to see
  243.    * but a flash of light, before the message line has been replaced by a
  244. ***************
  245. *** 177,183 ****
  246.               is_ordinary_file, scount = 0;
  247.       int mesgnum;    /* message whose address is used for save-by-name fn */
  248.       char    filename[SLEN], address[LONG_STRING], buffer[LONG_STRING],
  249. !         ch;
  250.       FILE *save_file;
  251.   
  252.       oldstat = headers[current-1]->status;    /* remember */
  253. --- 186,192 ----
  254.               is_ordinary_file, scount = 0;
  255.       int mesgnum;    /* message whose address is used for save-by-name fn */
  256.       char    filename[SLEN], address[LONG_STRING], buffer[LONG_STRING],
  257. !         ch, msg_buffer[SLEN], answer;
  258.       FILE *save_file;
  259.   
  260.       oldstat = headers[current-1]->status;    /* remember */
  261. ***************
  262. *** 281,308 ****
  263.       if (access(filename,ACCESS_EXISTS)== 0) {    /* already there!! */
  264.           appending = 1;
  265.           if (confirm_append || (confirm_files && is_ordinary_file)) {
  266. !         PutLine1 (LINES-2, 0,
  267. !               /*
  268. !                *    Well it should be like this but...
  269. !               catgets (elm_msg_cat, ElmSet, ElmConfirmFiles,
  270. !                    "Append to an existing file `%s'? (y/n) "),
  271. !                */
  272. !               is_ordinary_file
  273. !               ? "Append to an existing file `%s'? (y/n) n"
  274. !               : "Append to mail folder `%s'? (y/n) n",
  275. !               filename);
  276. !         ch = ReadCh ();
  277. !         ch = tolower (ch);
  278. !         PutLine2 (LINES-2, 0,
  279. !               is_ordinary_file
  280. !               ? "Append to an existing file `%s'? (y/n) %s"
  281. !               : "Append to mail folder `%s'? (y/n) %s",
  282. !               filename,
  283. !               (ch == *def_ans_yes) ? "Yes" : "No");
  284. !         sleep (1);
  285. !         ClearLine (LINES-2);
  286.   
  287. !         if (ch != *def_ans_yes) {
  288.               goto Retry_Save_If_Not_Confirmed;
  289.           }
  290.           }
  291. --- 290,308 ----
  292.       if (access(filename,ACCESS_EXISTS)== 0) {    /* already there!! */
  293.           appending = 1;
  294.           if (confirm_append || (confirm_files && is_ordinary_file)) {
  295. !             if (is_ordinary_file)
  296. !               MCsprintf(msg_buffer, catgets(elm_msg_cat, ElmSet, ElmConfirmFilesAppend,
  297. !               "Append to an existing file `%s'? (%c/%c) "),
  298. !             filename, *def_ans_yes, *def_ans_no);
  299. !             else
  300. !               MCsprintf(msg_buffer, catgets(elm_msg_cat, ElmSet, ElmConfirmFolderAppend,
  301. !                   "Append to mail folder `%s'? (%c/%c) "),
  302. !             filename, *def_ans_yes, *def_ans_no);
  303. !             answer = want_to(buffer, *def_ans_no, LINES-2);
  304.   
  305. !         if (answer != *def_ans_yes) {
  306.               goto Retry_Save_If_Not_Confirmed;
  307.           }
  308.           }
  309. ***************
  310. *** 309,336 ****
  311.       }
  312.       else {
  313.               if (confirm_create || (confirm_folders && !is_ordinary_file)) {
  314. !         PutLine1 (LINES-2, 0,
  315. !               /*
  316. !                *    Well it should be like this but...
  317. !               catgets (elm_msg_cat, ElmSet, ElmConfirmFolders,
  318. !                    "Create a new mail folder `%s'? (y/n) "),
  319. !                */
  320. !               !is_ordinary_file
  321. !               ? "Create a new mail folder `%s'? (y/n) n"
  322. !               : "Create a new file `%s'? (y/n) n",
  323. !               filename);
  324. !         ch = ReadCh ();
  325. !         ch = tolower (ch);
  326. !         PutLine2 (LINES-2, 0,
  327. !               !is_ordinary_file
  328. !               ? "Create a new mail folder `%s'? (y/n) %s"
  329. !               : "Create a new file `%s'? (y/n) %s",
  330. !               filename,
  331. !               (ch == *def_ans_yes) ? "Yes" : "No");
  332. !         sleep (1);
  333. !         ClearLine (LINES-2);
  334.   
  335. !         if (ch != *def_ans_yes) {
  336.               goto Retry_Save_If_Not_Confirmed;
  337.           }
  338.           }
  339. --- 309,327 ----
  340.       }
  341.       else {
  342.               if (confirm_create || (confirm_folders && !is_ordinary_file)) {
  343. !             if (is_ordinary_file)
  344. !               MCsprintf(msg_buffer, catgets(elm_msg_cat, ElmSet, ElmConfirmFilesCreate,
  345. !               "Create a new file `%s'? (%c/%c) "),
  346. !             filename, *def_ans_yes, *def_ans_no);
  347. !             else
  348. !               MCsprintf(msg_buffer, catgets(elm_msg_cat, ElmSet, ElmConfirmFolderCreate,
  349. !                   "Create a new mail folder `%s'? (%c/%c) "),
  350. !             filename, *def_ans_yes, *def_ans_no);
  351. !             answer = want_to(buffer, *def_ans_no, LINES-2);
  352.   
  353. !         if (answer != *def_ans_yes) {
  354.               goto Retry_Save_If_Not_Confirmed;
  355.           }
  356.           }
  357.  
  358. Index: src/file_util.c
  359. Prereq: 5.3
  360. *** ../elm2.4/src/file_util.c    Thu Dec 24 18:56:51 1992
  361. --- src/file_util.c    Wed Dec 16 09:31:06 1992
  362. ***************
  363. *** 1,8 ****
  364.   
  365. ! static char rcsid[] = "@(#)$Id: file_util.c,v 5.3 1992/12/11 01:45:04 syd Exp $";
  366.   
  367.   /*******************************************************************************
  368. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  369.    *
  370.    *            Copyright (c) 1988-1992 USENET Community Trust
  371.    *            Copyright (c) 1986,1987 Dave Taylor
  372. --- 1,8 ----
  373.   
  374. ! static char rcsid[] = "@(#)$Id: file_util.c,v 5.4 1992/12/16 14:30:52 syd Exp $";
  375.   
  376.   /*******************************************************************************
  377. !  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
  378.    *
  379.    *            Copyright (c) 1988-1992 USENET Community Trust
  380.    *            Copyright (c) 1986,1987 Dave Taylor
  381. ***************
  382. *** 14,19 ****
  383. --- 14,23 ----
  384.    *
  385.    *******************************************************************************
  386.    * $Log: file_util.c,v $
  387. +  * Revision 5.4  1992/12/16  14:30:52  syd
  388. +  * Make forward to checking consistent on sign ignoring
  389. +  * From: Syd
  390. +  *
  391.    * Revision 5.3  1992/12/11  01:45:04  syd
  392.    * remove sys/types.h include, it is now included by defs.h
  393.    * and this routine includes defs.h or indirectly includes defs.h
  394. ***************
  395. *** 226,232 ****
  396.       /* file has reasonable size - see if forwarding */
  397.       else if (mail_gets (firstline, SLEN, fp) == 0)
  398.         retcode = 1;         /* empty? should have detected this above! */
  399. !     else if (first_word(firstline, FORWARDSIGN))
  400.         retcode = 2;                    /* forwarding */
  401.   
  402.       /* not forwarding - so file must have some mail in it */
  403. --- 230,236 ----
  404.       /* file has reasonable size - see if forwarding */
  405.       else if (mail_gets (firstline, SLEN, fp) == 0)
  406.         retcode = 1;         /* empty? should have detected this above! */
  407. !     else if (first_word_nc(firstline, FORWARDSIGN))
  408.         retcode = 2;                    /* forwarding */
  409.   
  410.       /* not forwarding - so file must have some mail in it */
  411.  
  412. Index: src/in_utils.c
  413. Prereq: 5.2
  414. *** ../elm2.4/src/in_utils.c    Tue Nov 17 14:11:04 1992
  415. --- src/in_utils.c    Thu Dec 24 16:42:10 1992
  416. ***************
  417. *** 1,8 ****
  418.   
  419. ! static char rcsid[] = "@(#)$Id: in_utils.c,v 5.2 1992/11/15 01:15:28 syd Exp $";
  420.   
  421.   /*******************************************************************************
  422. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  423.    *
  424.    *            Copyright (c) 1988-1992 USENET Community Trust
  425.    *            Copyright (c) 1986,1987 Dave Taylor
  426. --- 1,8 ----
  427.   
  428. ! static char rcsid[] = "@(#)$Id: in_utils.c,v 5.3 1992/12/24 21:42:01 syd Exp $";
  429.   
  430.   /*******************************************************************************
  431. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  432.    *
  433.    *            Copyright (c) 1988-1992 USENET Community Trust
  434.    *            Copyright (c) 1986,1987 Dave Taylor
  435. ***************
  436. *** 14,19 ****
  437. --- 14,24 ----
  438.    *
  439.    *******************************************************************************
  440.    * $Log: in_utils.c,v $
  441. +  * Revision 5.3  1992/12/24  21:42:01  syd
  442. +  * Fix messages and nls messages to match.  Plus use want_to
  443. +  * where appropriate.
  444. +  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
  445. +  *
  446.    * Revision 5.2  1992/11/15  01:15:28  syd
  447.    * The alias message_count isn't set to zero if the last alias has
  448.    * been deleted from the alias table. As no aliases are reread from
  449. ***************
  450. *** 58,67 ****
  451.                         Writechar(BACKSPACE); fflush(stdout); }
  452.   
  453.   int
  454. ! want_to(question, dflt)
  455.   char *question, dflt;
  456.   {
  457. !     /** Ask 'question' on LINES-2 left enough to just leave room for an
  458.           answer, returning the answer in lower case.
  459.           Echo answer as full "Yes" or "No".  'dflt' is the 
  460.           default answer if <return> is pressed. (Note: 'dflt' is also what 
  461. --- 63,73 ----
  462.                         Writechar(BACKSPACE); fflush(stdout); }
  463.   
  464.   int
  465. ! want_to(question, dflt, where)
  466.   char *question, dflt;
  467. + int where;
  468.   {
  469. !     /** Ask 'question' on 'where' left enough to just leave room for an
  470.           answer, returning the answer in lower case.
  471.           Echo answer as full "Yes" or "No".  'dflt' is the 
  472.           default answer if <return> is pressed. (Note: 'dflt' is also what 
  473. ***************
  474. *** 71,79 ****
  475.   
  476.       cols = COLUMNS - (strlen(question) + 5 );    /* 5 for "Yes." + 1 */
  477.   
  478. !     MoveCursor(LINES-3, cols);
  479.       CleartoEOLN();
  480. !     PutLine3(LINES-3, cols,"%s%c%c", question, dflt, BACKSPACE);
  481.       fflush(stdout);
  482.       fflush(stdin);
  483.   
  484. --- 77,85 ----
  485.   
  486.       cols = COLUMNS - (strlen(question) + 5 );    /* 5 for "Yes." + 1 */
  487.   
  488. !     MoveCursor(where, cols);
  489.       CleartoEOLN();
  490. !     PutLine3(where, cols,"%s%c%c", question, dflt, BACKSPACE);
  491.       fflush(stdout);
  492.       fflush(stdin);
  493.   
  494. ***************
  495. *** 88,96 ****
  496.         ch = dflt;
  497.   
  498.       if(ch == *def_ans_yes)
  499. !       Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmYes, "Yes."), 0);
  500.       else
  501. !       Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmNo, "No."), 0);
  502.   
  503.       return(ch);
  504.   }
  505. --- 94,102 ----
  506.         ch = dflt;
  507.   
  508.       if(ch == *def_ans_yes)
  509. !       Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmYesWord, "Yes."), 0);
  510.       else
  511. !       Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmNoWord, "No."), 0);
  512.   
  513.       return(ch);
  514.   }
  515.  
  516. Index: src/leavembox.c
  517. Prereq: 5.7
  518. *** ../elm2.4/src/leavembox.c    Thu Dec 24 18:56:47 1992
  519. --- src/leavembox.c    Thu Dec 24 16:59:21 1992
  520. ***************
  521. *** 1,8 ****
  522.   
  523. ! static char rcsid[] = "@(#)$Id: leavembox.c,v 5.7 1992/12/11 01:45:04 syd Exp $";
  524.   
  525.   /*******************************************************************************
  526. !  *  The Elm Mail System  -  $Revision: 5.7 $   $State: Exp $
  527.    *
  528.    *            Copyright (c) 1988-1992 USENET Community Trust
  529.    *            Copyright (c) 1986,1987 Dave Taylor
  530. --- 1,8 ----
  531.   
  532. ! static char rcsid[] = "@(#)$Id: leavembox.c,v 5.9 1992/12/24 21:58:52 syd Exp $";
  533.   
  534.   /*******************************************************************************
  535. !  *  The Elm Mail System  -  $Revision: 5.9 $   $State: Exp $
  536.    *
  537.    *            Copyright (c) 1988-1992 USENET Community Trust
  538.    *            Copyright (c) 1986,1987 Dave Taylor
  539. ***************
  540. *** 14,19 ****
  541. --- 14,28 ----
  542.    *
  543.    *******************************************************************************
  544.    * $Log: leavembox.c,v $
  545. +  * Revision 5.9  1992/12/24  21:58:52  syd
  546. +  * Add lstat call to properly detect symlink
  547. +  * From: Syd via partial patch from Bryan Curnutt
  548. +  *
  549. +  * Revision 5.8  1992/12/24  21:42:01  syd
  550. +  * Fix messages and nls messages to match.  Plus use want_to
  551. +  * where appropriate.
  552. +  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
  553. +  *
  554.    * Revision 5.7  1992/12/11  01:45:04  syd
  555.    * remove sys/types.h include, it is now included by defs.h
  556.    * and this routine includes defs.h or indirectly includes defs.h
  557. ***************
  558. *** 136,141 ****
  559. --- 145,153 ----
  560.       FILE *temp;
  561.       char temp_keep_file[SLEN], buffer[SLEN];
  562.       struct stat    buf;        /* stat command  */
  563. + #ifdef SYMLINK
  564. +     struct stat    lbuf;        /* lstat command  */
  565. + #endif
  566.   #ifdef BSD
  567.       time_t utime_buffer[2];        /* utime command */
  568.   #else
  569. ***************
  570. *** 185,191 ****
  571.           else
  572.             MCsprintf(buffer, catgets(elm_msg_cat, ElmSet, ElmLeaveDeleteMessages,
  573.           "Delete messages? (%c/%c) "), *def_ans_yes, *def_ans_no);
  574. !         answer = want_to(buffer, answer);
  575.         }
  576.   
  577.         if(answer == *def_ans_yes) {
  578. --- 197,203 ----
  579.           else
  580.             MCsprintf(buffer, catgets(elm_msg_cat, ElmSet, ElmLeaveDeleteMessages,
  581.           "Delete messages? (%c/%c) "), *def_ans_yes, *def_ans_no);
  582. !         answer = want_to(buffer, answer, LINES-3);
  583.         }
  584.   
  585.         if(answer == *def_ans_yes) {
  586. ***************
  587. *** 237,243 ****
  588.           MCsprintf(buffer, catgets(elm_msg_cat, ElmSet, ElmLeaveMoveMessages,
  589.               "Move read messages to \"received\" folder? (%c/%c) "),
  590.               *def_ans_yes, *def_ans_no);
  591. !           answer = want_to(buffer, answer);
  592.             asked_storage_q = TRUE;
  593.           }
  594.   
  595. --- 249,255 ----
  596.           MCsprintf(buffer, catgets(elm_msg_cat, ElmSet, ElmLeaveMoveMessages,
  597.               "Move read messages to \"received\" folder? (%c/%c) "),
  598.               *def_ans_yes, *def_ans_no);
  599. !           answer = want_to(buffer, answer, LINES-3);
  600.             asked_storage_q = TRUE;
  601.           }
  602.   
  603. ***************
  604. *** 291,297 ****
  605.             MCsprintf(buffer, catgets(elm_msg_cat, ElmSet, ElmLeaveKeepMessages,
  606.               "Keep unread messages in incoming mailbox? (%c/%c) "),
  607.               *def_ans_yes, *def_ans_no);
  608. !         answer = want_to(buffer, answer);
  609.             }
  610.   
  611.             for (i = 0; i < message_count; i++) {
  612. --- 303,309 ----
  613.             MCsprintf(buffer, catgets(elm_msg_cat, ElmSet, ElmLeaveKeepMessages,
  614.               "Keep unread messages in incoming mailbox? (%c/%c) "),
  615.               *def_ans_yes, *def_ans_no);
  616. !         answer = want_to(buffer, answer, LINES-3);
  617.             }
  618.   
  619.             for (i = 0; i < message_count; i++) {
  620. ***************
  621. *** 577,582 ****
  622. --- 589,604 ----
  623.           "Error %s on stat(%s)."), error_description(err), cur_folder);
  624.       }
  625.   
  626. + #ifdef SYMLINK
  627. +         if (lstat(cur_folder, &lbuf) != 0) {
  628. +       err = errno;
  629. +       dprint(1, (debugfile, "Error: errno %s attempting to stat file %s\n", 
  630. +              error_description(err), cur_folder));
  631. +           error2(catgets(elm_msg_cat, ElmSet, ElmLeaveErrorOnStat,
  632. +         "Error %s on stat(%s)."), error_description(err), cur_folder);
  633. +     }
  634. + #endif
  635.       /* Close and remove the original folder.
  636.        * However, if we are going to copy a temp file of kept messages
  637.        * to it, and this is a locked (spool) mailbox, we need to keep
  638. ***************
  639. *** 616,624 ****
  640.   
  641.   #ifdef SYMLINK
  642.   #ifdef S_ISLNK
  643. !       if (S_ISLNK(buf.st_mode))
  644.   #else
  645. !       if ((buf.st_mode & S_IFMT) == S_IFLNK)
  646.   #endif
  647.         {
  648.            need_to_copy = TRUE;
  649. --- 638,646 ----
  650.   
  651.   #ifdef SYMLINK
  652.   #ifdef S_ISLNK
  653. !       if (S_ISLNK(lbuf.st_mode))
  654.   #else
  655. !       if ((lbuf.st_mode & S_IFMT) == S_IFLNK)
  656.   #endif
  657.         {
  658.            need_to_copy = TRUE;
  659.  
  660. Index: src/limit.c
  661. Prereq: 5.1
  662. *** ../elm2.4/src/limit.c    Sat Oct  3 18:59:00 1992
  663. --- src/limit.c    Thu Dec 24 16:42:12 1992
  664. ***************
  665. *** 1,8 ****
  666.   
  667. ! static char rcsid[] = "@(#)$Id: limit.c,v 5.1 1992/10/03 22:58:40 syd Exp $";
  668.   
  669.   /*******************************************************************************
  670. !  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
  671.    *
  672.    *            Copyright (c) 1988-1992 USENET Community Trust
  673.    *            Copyright (c) 1986,1987 Dave Taylor
  674. --- 1,8 ----
  675.   
  676. ! static char rcsid[] = "@(#)$Id: limit.c,v 5.2 1992/12/24 21:42:01 syd Exp $";
  677.   
  678.   /*******************************************************************************
  679. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  680.    *
  681.    *            Copyright (c) 1988-1992 USENET Community Trust
  682.    *            Copyright (c) 1986,1987 Dave Taylor
  683. ***************
  684. *** 14,19 ****
  685. --- 14,24 ----
  686.    *
  687.    *******************************************************************************
  688.    * $Log: limit.c,v $
  689. +  * Revision 5.2  1992/12/24  21:42:01  syd
  690. +  * Fix messages and nls messages to match.  Plus use want_to
  691. +  * where appropriate.
  692. +  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
  693. +  *
  694.    * Revision 5.1  1992/10/03  22:58:40  syd
  695.    * Initial checkin as of 2.4 Release at PL0
  696.    *
  697. ***************
  698. *** 61,71 ****
  699.         PutLine0(LINES-2, 0, msg);
  700.         criteria[0] = ReadCh();
  701.         if (tolower(criteria[0]) == *def_ans_yes) {
  702. !         Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmLimitYes, "Yes."), 0);
  703.           PutLine0(LINES-3, COLUMNS-30, catgets(elm_msg_cat, ElmSet, ElmLimitAdding,
  704.           "Adding criteria..."));
  705.         } else {
  706. !         Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmLimitNo, "No."), 0);
  707.           selected = 0;
  708.           PutLine0(LINES-3, COLUMNS-30, catgets(elm_msg_cat, ElmSet, ElmLimitChanging,
  709.           "Change criteria..."));
  710. --- 66,76 ----
  711.         PutLine0(LINES-2, 0, msg);
  712.         criteria[0] = ReadCh();
  713.         if (tolower(criteria[0]) == *def_ans_yes) {
  714. !         Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmYesWord, "Yes."), 0);
  715.           PutLine0(LINES-3, COLUMNS-30, catgets(elm_msg_cat, ElmSet, ElmLimitAdding,
  716.           "Adding criteria..."));
  717.         } else {
  718. !         Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmNoWord, "No."), 0);
  719.           selected = 0;
  720.           PutLine0(LINES-3, COLUMNS-30, catgets(elm_msg_cat, ElmSet, ElmLimitChanging,
  721.           "Change criteria..."));
  722.  
  723. Index: src/mailmsg1.c
  724. Prereq: 5.1
  725. *** ../elm2.4/src/mailmsg1.c    Sat Oct  3 18:59:01 1992
  726. --- src/mailmsg1.c    Thu Dec 24 16:42:13 1992
  727. ***************
  728. *** 1,8 ****
  729.   
  730. ! static char rcsid[] = "@(#)$Id: mailmsg1.c,v 5.1 1992/10/03 22:58:40 syd Exp $";
  731.   
  732.   /*******************************************************************************
  733. !  *  The Elm Mail System  -  $Revision: 5.1 $   $State: Exp $
  734.    *
  735.    *            Copyright (c) 1988-1992 USENET Community Trust
  736.    *            Copyright (c) 1986,1987 Dave Taylor
  737. --- 1,8 ----
  738.   
  739. ! static char rcsid[] = "@(#)$Id: mailmsg1.c,v 5.3 1992/12/24 21:42:01 syd Exp $";
  740.   
  741.   /*******************************************************************************
  742. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  743.    *
  744.    *            Copyright (c) 1988-1992 USENET Community Trust
  745.    *            Copyright (c) 1986,1987 Dave Taylor
  746. ***************
  747. *** 14,19 ****
  748. --- 14,29 ----
  749.    *
  750.    *******************************************************************************
  751.    * $Log: mailmsg1.c,v $
  752. +  * Revision 5.3  1992/12/24  21:42:01  syd
  753. +  * Fix messages and nls messages to match.  Plus use want_to
  754. +  * where appropriate.
  755. +  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
  756. +  *
  757. +  * Revision 5.2  1992/12/20  05:15:58  syd
  758. +  * Add a c)hange alias, -u and -t options to listalias to list only user
  759. +  * and only system aliases respectively.
  760. +  * From: "Robert L. Howard" <robert.howard@matd.gatech.edu>
  761. +  *
  762.    * Revision 5.1  1992/10/03  22:58:40  syd
  763.    * Initial checkin as of 2.4 Release at PL0
  764.    *
  765. ***************
  766. *** 268,286 ****
  767.   
  768.       if (strlen(subject_field) == 0) {    /* zero length subject?? */
  769.         MCsprintf(msgbuf, catgets(elm_msg_cat, ElmSet, ElmNoSubjectContinue,
  770. !         "No subject - Continue with message? (%c/%c) %c%c"),
  771. !         *def_ans_yes, *def_ans_no, *def_ans_no, BACKSPACE);
  772. !       PutLine0(prompt_line, 0, msgbuf);
  773. !       ch = ReadCh();
  774. !       if (tolower(ch) != *def_ans_yes) {    /* user says no! */
  775. !         Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmNo, "No."), 0);
  776.           ClearLine(prompt_line);
  777.           error(catgets(elm_msg_cat, ElmSet, ElmMailNotSend, "Mail not sent."));
  778.           return(0);
  779.         }
  780.         else {
  781. -         Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmYes, "Yes."), 0);
  782.           PutLine0(prompt_line,0,"Subject: <none>");
  783.           CleartoEOLN();
  784.         }
  785. --- 278,294 ----
  786.   
  787.       if (strlen(subject_field) == 0) {    /* zero length subject?? */
  788.         MCsprintf(msgbuf, catgets(elm_msg_cat, ElmSet, ElmNoSubjectContinue,
  789. !         "No subject - Continue with message? (%c/%c) "),
  790. !         *def_ans_yes, *def_ans_no);
  791. !       ch = want_to(msgbuf, *def_ans_no, prompt_line);
  792. !       if (ch != *def_ans_yes) {    /* user says no! */
  793. !         sleep(1);
  794.           ClearLine(prompt_line);
  795.           error(catgets(elm_msg_cat, ElmSet, ElmMailNotSend, "Mail not sent."));
  796.           return(0);
  797.         }
  798.         else {
  799.           PutLine0(prompt_line,0,"Subject: <none>");
  800.           CleartoEOLN();
  801.         }
  802. ***************
  803. *** 364,370 ****
  804.         else {
  805.           MCsprintf(msg, catgets(elm_msg_cat, ElmSet, ElmCopyMessageYN,
  806.           "Copy message? (%c/%c) "), *def_ans_yes, *def_ans_no);
  807. !         answer = (want_to(msg, *def_ans_no) == *def_ans_yes);
  808.         }
  809.         *is_a_response = TRUE;
  810.       }
  811. --- 372,378 ----
  812.         else {
  813.           MCsprintf(msg, catgets(elm_msg_cat, ElmSet, ElmCopyMessageYN,
  814.           "Copy message? (%c/%c) "), *def_ans_yes, *def_ans_no);
  815. !         answer = (want_to(msg, *def_ans_no, LINES-3) == *def_ans_yes);
  816.         }
  817.         *is_a_response = TRUE;
  818.       }
  819. ***************
  820. *** 387,392 ****
  821. --- 395,401 ----
  822.       **/
  823.   
  824.       register int tagged = 0, i;
  825. +     int ret;
  826.   
  827.       /* First: zero all current global message strings */
  828.   
  829. ***************
  830. *** 400,407 ****
  831.         if (ison(aliases[i]->status, TAGGED)) {
  832.           strcat(to, aliases[i]->alias);
  833.           strcat(to, " ");
  834. -         clearit(aliases[i]->status, TAGGED);
  835. -         show_msg_tag(i);
  836.           tagged++;
  837.         }
  838.       }
  839. --- 409,414 ----
  840. ***************
  841. *** 408,418 ****
  842.   
  843.       if (tagged == 0) {
  844.         strcpy(to, aliases[current-1]->alias);
  845. -       tagged = 1;
  846.       }
  847.   
  848. !     dprint(4, (debugfile, "%d message%s tagged for mailing (a_sndmsg)\n",
  849. !             tagged, plural(tagged)));
  850.   
  851.       /******* And now the real stuff! *******/
  852.   
  853. --- 415,424 ----
  854.   
  855.       if (tagged == 0) {
  856.         strcpy(to, aliases[current-1]->alias);
  857.       }
  858.   
  859. !     dprint(4, (debugfile, "%d aliases tagged for mailing (a_sndmsg)\n",
  860. !             tagged));
  861.   
  862.       /******* And now the real stuff! *******/
  863.   
  864. ***************
  865. *** 442,449 ****
  866.       dprint(5, (debugfile, "bcc=\"%s\" expanded_bcc=\"%s\"\n",bcc,expanded_bcc));
  867.   
  868.       main_state();
  869. !     i = mail(FALSE, edit_message, form_letter);
  870.       main_state();
  871.   
  872. !     return(i);
  873.   }
  874. --- 448,468 ----
  875.       dprint(5, (debugfile, "bcc=\"%s\" expanded_bcc=\"%s\"\n",bcc,expanded_bcc));
  876.   
  877.       main_state();
  878. !     ret = mail(FALSE, edit_message, form_letter);
  879.       main_state();
  880.   
  881. ! /*
  882. !  *    Since we got this far, it must be okay to clear the tags.
  883. !  */
  884. !     i = 0;
  885. !     while (tagged) {
  886. !         if (ison(aliases[i]->status, TAGGED)) {
  887. !             clearit(aliases[i]->status, TAGGED);
  888. !             show_msg_tag(i);
  889. !             tagged--;
  890. !         }
  891. !         i++;
  892. !     }
  893. !     return(ret);
  894.   }
  895.  
  896. Index: src/mailmsg2.c
  897. Prereq: 5.12
  898. *** ../elm2.4/src/mailmsg2.c    Thu Dec 24 18:56:52 1992
  899. --- src/mailmsg2.c    Mon Dec 28 09:24:38 1992
  900. ***************
  901. *** 1,8 ****
  902.   
  903. ! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 5.12 1992/12/11 01:58:50 syd Exp $";
  904.   
  905.   /*******************************************************************************
  906. !  *  The Elm Mail System  -  $Revision: 5.12 $   $State: Exp $
  907.    *
  908.    *             Copyright (c) 1988-1992 USENET Community Trust
  909.    *             Copyright (c) 1986,1987 Dave Taylor
  910. --- 1,8 ----
  911.   
  912. ! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 5.15 1992/12/28 14:24:25 syd Exp $";
  913.   
  914.   /*******************************************************************************
  915. !  *  The Elm Mail System  -  $Revision: 5.15 $   $State: Exp $
  916.    *
  917.    *             Copyright (c) 1988-1992 USENET Community Trust
  918.    *             Copyright (c) 1986,1987 Dave Taylor
  919. ***************
  920. *** 14,19 ****
  921. --- 14,33 ----
  922.    *
  923.    *******************************************************************************
  924.    * $Log: mailmsg2.c,v $
  925. +  * Revision 5.15  1992/12/28  14:24:25  syd
  926. +  * Fix problem where it won't let no answer on recall last message
  927. +  * From: Syd
  928. +  *
  929. +  * Revision 5.14  1992/12/24  21:42:01  syd
  930. +  * Fix messages and nls messages to match.  Plus use want_to
  931. +  * where appropriate.
  932. +  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
  933. +  *
  934. +  * Revision 5.13  1992/12/20  05:04:51  syd
  935. +  * restore unintnded prefix_chars that caused forwarding without editing
  936. +  * to add prefix
  937. +  * From: Syd
  938. +  *
  939.    * Revision 5.12  1992/12/11  01:58:50  syd
  940.    * Allow for use from restricted shell by putting SHELL=/bin/sh in the
  941.    * environment of spawned mail transport program.
  942. ***************
  943. *** 299,305 ****
  944.           already_has_text = TRUE;    /* we just added it, right? */
  945.         }
  946.         else
  947. !         copy_message(prefixchars, reply,
  948.           ( noheader ? CM_REMOVE_HEADER : 0 ) | CM_MMDF_HEAD);
  949.       }
  950.   
  951. --- 313,319 ----
  952.           already_has_text = TRUE;    /* we just added it, right? */
  953.         }
  954.         else
  955. !         copy_message("", reply,
  956.           ( noheader ? CM_REMOVE_HEADER : 0 ) | CM_MMDF_HEAD);
  957.       }
  958.   
  959. ***************
  960. *** 575,581 ****
  961.               "mailer returned error status %d"), sys_status);
  962.              printf("\r\n");
  963.           } else {
  964. !            sprintf(very_long_buffer, catgets(elm_msg_cat, ElmSet, ElmCouldNotCreateFile,
  965.               "mailer returned error status %d"), sys_status);
  966.              set_error(very_long_buffer);
  967.           }
  968. --- 589,595 ----
  969.               "mailer returned error status %d"), sys_status);
  970.              printf("\r\n");
  971.           } else {
  972. !            sprintf(very_long_buffer, catgets(elm_msg_cat, ElmSet, ElmMailerReturnedError,
  973.               "mailer returned error status %d"), sys_status);
  974.              set_error(very_long_buffer);
  975.           }
  976. ***************
  977. *** 642,659 ****
  978.                "Recall last kept message? (%c/%c) "),
  979.                *def_ans_yes, *def_ans_no);
  980.         do {
  981. !         PutLine0(LINES-1, 0, msg);
  982. !         CleartoEOLN();
  983. !         fflush(stdout);
  984. !         ch = ReadCh();
  985. !         ch = tolower(ch);
  986.           if (ch == *def_ans_yes) {
  987. -           Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmYes, "Yes."), 0);    
  988.                 retransmit++;
  989.             *already_has_text = TRUE;
  990. !         } else if (ch == *def_ans_no) {
  991. !           Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmNo, "No."), 0);    
  992. !         } else {
  993.             Write_to_screen("%c??", 1, 07);    /* BEEP */
  994.             sleep(1);
  995.             ch = 0;
  996. --- 656,666 ----
  997.                "Recall last kept message? (%c/%c) "),
  998.                *def_ans_yes, *def_ans_no);
  999.         do {
  1000. !         ch = want_to(msg, '\0', LINES-1);
  1001.           if (ch == *def_ans_yes) {
  1002.                 retransmit++;
  1003.             *already_has_text = TRUE;
  1004. !         } else if (ch != *def_ans_no) {
  1005.             Write_to_screen("%c??", 1, 07);    /* BEEP */
  1006.             sleep(1);
  1007.             ch = 0;
  1008. ***************
  1009. *** 1196,1216 ****
  1010.       MoveCursor(LINES,0);
  1011.       CleartoEOLN();
  1012.       MCsprintf(msg, catgets(elm_msg_cat, ElmSet, ElmBounceOffRemote,
  1013. !           "\"Bounce\" a copy off the remote machine? (%c/%c) %c%c"),
  1014. !           *def_ans_yes, *def_ans_no, *def_ans_yes, BACKSPACE);
  1015. !     PutLine0(LINES,0, msg);
  1016. !     fflush(stdin);    /* wait for answer! */
  1017. !     fflush(stdout);
  1018. !     ch = ReadCh();
  1019. !     if (tolower(ch) != *def_ans_yes) { 
  1020. !       Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmNo, "No."), 0);
  1021. !       fflush(stdout);
  1022. !       return(FALSE);
  1023. !     }
  1024. !     Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmYes, "Yes."), 0);
  1025. !     fflush(stdout);
  1026. !     return(TRUE);
  1027.   }
  1028.   
  1029.   
  1030. --- 1203,1212 ----
  1031.       MoveCursor(LINES,0);
  1032.       CleartoEOLN();
  1033.       MCsprintf(msg, catgets(elm_msg_cat, ElmSet, ElmBounceOffRemote,
  1034. !           "\"Bounce\" a copy off the remote machine? (%c/%c) "),
  1035. !           *def_ans_yes, *def_ans_no);
  1036. !     ch = want_to(msg, *def_ans_no, LINES);
  1037. !     return (ch == *def_ans_yes);
  1038.   }
  1039.   
  1040.   
  1041.  
  1042. Index: src/pattern.c
  1043. Prereq: 5.2
  1044. *** ../elm2.4/src/pattern.c    Thu Dec 24 18:56:59 1992
  1045. --- src/pattern.c    Thu Dec 24 19:30:44 1992
  1046. ***************
  1047. *** 1,8 ****
  1048.   
  1049. ! static char rcsid[] = "@(#)$Id: pattern.c,v 5.2 1992/11/26 00:46:50 syd Exp $";
  1050.   
  1051.   /*******************************************************************************
  1052. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  1053.    *
  1054.    *            Copyright (c) 1988-1992 USENET Community Trust
  1055.    *            Copyright (c) 1986,1987 Dave Taylor
  1056. --- 1,8 ----
  1057.   
  1058. ! static char rcsid[] = "@(#)$Id: pattern.c,v 5.5 1992/12/25 00:30:37 syd Exp $";
  1059.   
  1060.   /*******************************************************************************
  1061. !  *  The Elm Mail System  -  $Revision: 5.5 $   $State: Exp $
  1062.    *
  1063.    *            Copyright (c) 1988-1992 USENET Community Trust
  1064.    *            Copyright (c) 1986,1987 Dave Taylor
  1065. ***************
  1066. *** 14,19 ****
  1067. --- 14,31 ----
  1068.    *
  1069.    *******************************************************************************
  1070.    * $Log: pattern.c,v $
  1071. +  * Revision 5.5  1992/12/25  00:30:37  syd
  1072. +  * change way message works
  1073. +  *
  1074. +  * Revision 5.4  1992/12/25  00:22:39  syd
  1075. +  * add missing *
  1076. +  * From: Syd
  1077. +  *
  1078. +  * Revision 5.3  1992/12/24  21:42:01  syd
  1079. +  * Fix messages and nls messages to match.  Plus use want_to
  1080. +  * where appropriate.
  1081. +  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
  1082. +  *
  1083.    * Revision 5.2  1992/11/26  00:46:50  syd
  1084.    * Fix how errno is used so err is inited and used instead
  1085.    * as errno gets overwritten by print system call
  1086. ***************
  1087. *** 58,64 ****
  1088.   meta_match(function)
  1089.   int function;
  1090.   {
  1091. !     char    ch;
  1092.   
  1093.       /** Perform specific function based on whether an entered string 
  1094.           matches either the From or Subject lines.. 
  1095. --- 70,76 ----
  1096.   meta_match(function)
  1097.   int function;
  1098.   {
  1099. !     char    ch, tagmsg[SLEN];
  1100.   
  1101.       /** Perform specific function based on whether an entered string 
  1102.           matches either the From or Subject lines.. 
  1103. ***************
  1104. *** 94,117 ****
  1105.   
  1106.         if (tagged) {
  1107.           if (tagged > 1) {
  1108. !           PutLine1(LINES-2,0, catgets(elm_msg_cat, ElmSet, ElmSomeMessagesATagged,
  1109.           "Some %s are already tagged."), items);
  1110.             MCsprintf(msg, catgets(elm_msg_cat, ElmSet, ElmRemoveTags,
  1111. !         "Remove Tags? (%c/%c) %c%c"),
  1112. !         *def_ans_yes, *def_ans_no, *def_ans_yes, BACKSPACE);
  1113.           } else {
  1114. !           PutLine1(LINES-2,0, catgets(elm_msg_cat, ElmSet, ElmAMessageATagged,
  1115.           "One %s is already tagged."), item);
  1116.             MCsprintf(msg, catgets(elm_msg_cat, ElmSet, ElmRemoveTag,
  1117. !         "Remove Tag? (%c/%c) %c%c"),
  1118. !         *def_ans_yes, *def_ans_no, *def_ans_yes, BACKSPACE);
  1119.           }
  1120.       
  1121. !         Write_to_screen(msg, 0);
  1122. !         ch = ReadCh();
  1123. !         if (tolower(ch) != *def_ans_no) {    /* remove tags... */
  1124. !           Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmYes, "Yes."), 0);
  1125.             for (i=0; i < message_count; i++) {
  1126.               if (inalias)
  1127.                 clearit(aliases[i]->status,TAGGED);
  1128. --- 106,126 ----
  1129.   
  1130.         if (tagged) {
  1131.           if (tagged > 1) {
  1132. !           MCsprintf(tagmsg, catgets(elm_msg_cat, ElmSet, ElmSomeMessagesATagged,
  1133.           "Some %s are already tagged."), items);
  1134.             MCsprintf(msg, catgets(elm_msg_cat, ElmSet, ElmRemoveTags,
  1135. !         "%s Remove Tags? (%c/%c) %c%c"),
  1136. !         tagmsg, *def_ans_yes, *def_ans_no);
  1137.           } else {
  1138. !           MCsprintf(tagmsg, catgets(elm_msg_cat, ElmSet, ElmAMessageATagged,
  1139.           "One %s is already tagged."), item);
  1140.             MCsprintf(msg, catgets(elm_msg_cat, ElmSet, ElmRemoveTag,
  1141. !         "%s Remove Tag? (%c/%c) "),
  1142. !         tagmsg, *def_ans_yes, *def_ans_no);
  1143.           }
  1144.       
  1145. !         ch = want_to(msg, *def_ans_yes, LINES-2);
  1146. !         if (ch != *def_ans_no) {    /* remove tags... */
  1147.             for (i=0; i < message_count; i++) {
  1148.               if (inalias)
  1149.                 clearit(aliases[i]->status,TAGGED);
  1150. ***************
  1151. *** 119,126 ****
  1152.                 clearit(headers[i]->status,TAGGED);
  1153.           show_new_status(i);
  1154.             }
  1155. !         } else
  1156. !           Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmNo, "No."), 0);
  1157.         }
  1158.       }
  1159.       
  1160. --- 128,134 ----
  1161.                 clearit(headers[i]->status,TAGGED);
  1162.           show_new_status(i);
  1163.             }
  1164. !         }
  1165.         }
  1166.       }
  1167.       
  1168.  
  1169. Index: src/remail.c
  1170. Prereq: 5.6
  1171. *** ../elm2.4/src/remail.c    Thu Dec 24 18:57:00 1992
  1172. --- src/remail.c    Thu Dec 24 16:42:16 1992
  1173. ***************
  1174. *** 1,8 ****
  1175.   
  1176. ! static char rcsid[] = "@(#)$Id: remail.c,v 5.6 1992/11/26 01:46:26 syd Exp $";
  1177.   
  1178.   /*******************************************************************************
  1179. !  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
  1180.    *
  1181.    *            Copyright (c) 1988-1992 USENET Community Trust
  1182.    *            Copyright (c) 1986,1987 Dave Taylor
  1183. --- 1,8 ----
  1184.   
  1185. ! static char rcsid[] = "@(#)$Id: remail.c,v 5.7 1992/12/24 21:42:01 syd Exp $";
  1186.   
  1187.   /*******************************************************************************
  1188. !  *  The Elm Mail System  -  $Revision: 5.7 $   $State: Exp $
  1189.    *
  1190.    *            Copyright (c) 1988-1992 USENET Community Trust
  1191.    *            Copyright (c) 1986,1987 Dave Taylor
  1192. ***************
  1193. *** 14,19 ****
  1194. --- 14,24 ----
  1195.    *
  1196.    *******************************************************************************
  1197.    * $Log: remail.c,v $
  1198. +  * Revision 5.7  1992/12/24  21:42:01  syd
  1199. +  * Fix messages and nls messages to match.  Plus use want_to
  1200. +  * where appropriate.
  1201. +  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
  1202. +  *
  1203.    * Revision 5.6  1992/11/26  01:46:26  syd
  1204.    * add Decode option to copy_message, convert copy_message to
  1205.    * use bit or for options.
  1206. ***************
  1207. *** 118,137 ****
  1208.       ClearLine(LINES-1);
  1209.       ClearLine(LINES);
  1210.       MCsprintf(buffer, catgets(elm_msg_cat, ElmSet, ElmSureYouWantToRemail,
  1211. !         "Are you sure you want to remail this message (%c/%c)? %c%c"),
  1212. !         *def_ans_yes, *def_ans_no, *def_ans_yes, BACKSPACE);
  1213. !     PutLine0(LINES-1, 0, buffer);
  1214.       fflush(stdin);
  1215. !     fflush(stdout);
  1216. !     ch = ReadCh();
  1217. !     if (tolower(ch) == *def_ans_no) { /* another day, another No... */
  1218. !       Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmNo, "No."), 0);
  1219.         set_error(catgets(elm_msg_cat, ElmSet, ElmBounceCancelled,
  1220.           "Bounce of message cancelled."));
  1221.         (void) unlink(filename);
  1222.         return(1);
  1223.       }
  1224. -     Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmYes, "Yes."), 0);
  1225.   
  1226.       if (strcmp(sendmail, mailer) == 0
  1227.   #ifdef SITE_HIDING
  1228. --- 123,138 ----
  1229.       ClearLine(LINES-1);
  1230.       ClearLine(LINES);
  1231.       MCsprintf(buffer, catgets(elm_msg_cat, ElmSet, ElmSureYouWantToRemail,
  1232. !         "Are you sure you want to remail this message (%c/%c)? "),
  1233. !         *def_ans_yes, *def_ans_no);
  1234.       fflush(stdin);
  1235. !     ch = want_to(buffer, *def_ans_yes, LINES-1);
  1236. !     if (ch == *def_ans_no) { /* another day, another No... */
  1237.         set_error(catgets(elm_msg_cat, ElmSet, ElmBounceCancelled,
  1238.           "Bounce of message cancelled."));
  1239.         (void) unlink(filename);
  1240.         return(1);
  1241.       }
  1242.   
  1243.       if (strcmp(sendmail, mailer) == 0
  1244.   #ifdef SITE_HIDING
  1245.  
  1246. Index: src/reply.c
  1247. Prereq: 5.6
  1248. *** ../elm2.4/src/reply.c    Thu Dec 24 18:57:00 1992
  1249. --- src/reply.c    Thu Dec 24 16:42:17 1992
  1250. ***************
  1251. *** 1,8 ****
  1252.   
  1253. ! static char rcsid[] = "@(#)$Id: reply.c,v 5.6 1992/12/11 01:45:04 syd Exp $";
  1254.   
  1255.   /*******************************************************************************
  1256. !  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
  1257.    *
  1258.    *            Copyright (c) 1988-1992 USENET Community Trust
  1259.    *            Copyright (c) 1986,1987 Dave Taylor
  1260. --- 1,8 ----
  1261.   
  1262. ! static char rcsid[] = "@(#)$Id: reply.c,v 5.7 1992/12/24 21:42:01 syd Exp $";
  1263.   
  1264.   /*******************************************************************************
  1265. !  *  The Elm Mail System  -  $Revision: 5.7 $   $State: Exp $
  1266.    *
  1267.    *            Copyright (c) 1988-1992 USENET Community Trust
  1268.    *            Copyright (c) 1986,1987 Dave Taylor
  1269. ***************
  1270. *** 14,19 ****
  1271. --- 14,24 ----
  1272.    *
  1273.    *******************************************************************************
  1274.    * $Log: reply.c,v $
  1275. +  * Revision 5.7  1992/12/24  21:42:01  syd
  1276. +  * Fix messages and nls messages to match.  Plus use want_to
  1277. +  * where appropriate.
  1278. +  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
  1279. +  *
  1280.    * Revision 5.6  1992/12/11  01:45:04  syd
  1281.    * remove sys/types.h include, it is now included by defs.h
  1282.    * and this routine includes defs.h or indirectly includes defs.h
  1283. ***************
  1284. *** 306,312 ****
  1285.           return_address,full_address));
  1286.   
  1287.       get_reply_subj( subject, headers[current-1]->subject,
  1288. !           catgets(elm_msg_cat, ElmSet, ElmFilledInForm, "Re: your mail"));
  1289.   
  1290.           return_value = send_msg(return_address, full_address, subject, 
  1291.           TRUE, NO, TRUE);
  1292. --- 311,317 ----
  1293.           return_address,full_address));
  1294.   
  1295.       get_reply_subj( subject, headers[current-1]->subject,
  1296. !           catgets(elm_msg_cat, ElmSet, ElmReYourMail, "Re: your mail"));
  1297.   
  1298.           return_value = send_msg(return_address, full_address, subject, 
  1299.           TRUE, NO, TRUE);
  1300. ***************
  1301. *** 339,345 ****
  1302.       else {
  1303.         MCsprintf(subject, catgets(elm_msg_cat, ElmSet, ElmEditOutgoingMessage,
  1304.             "Edit outgoing message? (%c/%c) "), *def_ans_yes, *def_ans_no);
  1305. !       edit_msg = (want_to(subject, *def_ans_yes) != *def_ans_no);
  1306.       }
  1307.   
  1308.       if (strlen(headers[current-1]->subject) > 0) {
  1309. --- 344,350 ----
  1310.       else {
  1311.         MCsprintf(subject, catgets(elm_msg_cat, ElmSet, ElmEditOutgoingMessage,
  1312.             "Edit outgoing message? (%c/%c) "), *def_ans_yes, *def_ans_no);
  1313. !       edit_msg = (want_to(subject, *def_ans_yes, LINES-3) != *def_ans_no);
  1314.       }
  1315.   
  1316.       if (strlen(headers[current-1]->subject) > 0) {
  1317.  
  1318. Index: src/returnadd.c
  1319. Prereq: 5.5
  1320. *** ../elm2.4/src/returnadd.c    Thu Dec 24 18:57:01 1992
  1321. --- src/returnadd.c    Sun Dec 20 00:25:14 1992
  1322. ***************
  1323. *** 1,8 ****
  1324.   
  1325. ! static char rcsid[] = "@(#)$Id: returnadd.c,v 5.5 1992/12/11 01:45:04 syd Exp $";
  1326.   
  1327.   /*******************************************************************************
  1328. !  *  The Elm Mail System  -  $Revision: 5.5 $   $State: Exp $
  1329.    *
  1330.    *            Copyright (c) 1988-1992 USENET Community Trust
  1331.    *            Copyright (c) 1986,1987 Dave Taylor
  1332. --- 1,8 ----
  1333.   
  1334. ! static char rcsid[] = "@(#)$Id: returnadd.c,v 5.6 1992/12/20 05:25:13 syd Exp $";
  1335.   
  1336.   /*******************************************************************************
  1337. !  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
  1338.    *
  1339.    *            Copyright (c) 1988-1992 USENET Community Trust
  1340.    *            Copyright (c) 1986,1987 Dave Taylor
  1341. ***************
  1342. *** 14,19 ****
  1343. --- 14,23 ----
  1344.    *
  1345.    *******************************************************************************
  1346.    * $Log: returnadd.c,v $
  1347. +  * Revision 5.6  1992/12/20  05:25:13  syd
  1348. +  * Always pass three parameters to header_cmp().
  1349. +  * From: chip@tct.com (Chip Salzenberg)
  1350. +  *
  1351.    * Revision 5.5  1992/12/11  01:45:04  syd
  1352.    * remove sys/types.h include, it is now included by defs.h
  1353.    * and this routine includes defs.h or indirectly includes defs.h
  1354. ***************
  1355. *** 231,237 ****
  1356.       else
  1357.         add_site(buffer, name1, lastname);    /* get the user name too! */
  1358.   
  1359. !     if (header_cmp(buffer, "To")) {    /* for backward compatibility */
  1360.         get_existing_address(buffer, msgnum);
  1361.         using_to = TRUE;
  1362.       }
  1363. --- 235,241 ----
  1364.       else
  1365.         add_site(buffer, name1, lastname);    /* get the user name too! */
  1366.   
  1367. !     if (header_cmp(buffer, "To", NULL)) {    /* backward compatibility ho */
  1368.         get_existing_address(buffer, msgnum);
  1369.         using_to = TRUE;
  1370.       }
  1371.  
  1372. Index: src/savecopy.c
  1373. Prereq: 5.4
  1374. *** ../elm2.4/src/savecopy.c    Thu Dec 24 18:57:01 1992
  1375. --- src/savecopy.c    Thu Dec 24 19:18:19 1992
  1376. ***************
  1377. *** 1,8 ****
  1378.   
  1379. ! static char rcsid[] = "@(#)$Id: savecopy.c,v 5.4 1992/11/26 00:46:50 syd Exp $";
  1380.   
  1381.   /*******************************************************************************
  1382. !  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
  1383.    *
  1384.    *             Copyright (c) 1988-1992 USENET Community Trust
  1385.    *             Copyright (c) 1986,1987 Dave Taylor
  1386. --- 1,8 ----
  1387.   
  1388. ! static char rcsid[] = "@(#)$Id: savecopy.c,v 5.6 1992/12/25 00:18:10 syd Exp $";
  1389.   
  1390.   /*******************************************************************************
  1391. !  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
  1392.    *
  1393.    *             Copyright (c) 1988-1992 USENET Community Trust
  1394.    *             Copyright (c) 1986,1987 Dave Taylor
  1395. ***************
  1396. *** 14,19 ****
  1397. --- 14,28 ----
  1398.    *
  1399.    *******************************************************************************
  1400.    * $Log: savecopy.c,v $
  1401. +  * Revision 5.6  1992/12/25  00:18:10  syd
  1402. +  * Remove editing garbage from end
  1403. +  * From: Syd
  1404. +  *
  1405. +  * Revision 5.5  1992/12/24  21:42:01  syd
  1406. +  * Fix messages and nls messages to match.  Plus use want_to
  1407. +  * where appropriate.
  1408. +  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
  1409. +  *
  1410.    * Revision 5.4  1992/11/26  00:46:50  syd
  1411.    * Fix how errno is used so err is inited and used instead
  1412.    * as errno gets overwritten by print system call
  1413. ***************
  1414. *** 81,87 ****
  1415.            *write_header_info();
  1416.       char  buffer[SLEN],    /* read buffer                */
  1417.             savename[SLEN],    /* name of file saving into    */
  1418. !           ch;
  1419.       register int
  1420.            is_ordinary_file;
  1421.       int  err;
  1422. --- 90,96 ----
  1423.            *write_header_info();
  1424.       char  buffer[SLEN],    /* read buffer                */
  1425.             savename[SLEN],    /* name of file saving into    */
  1426. !           ch, msg_buffer[SLEN], answer;
  1427.       register int
  1428.            is_ordinary_file;
  1429.       int  err;
  1430. ***************
  1431. *** 143,173 ****
  1432.               strcpy(savename, sent_mail);
  1433.           }
  1434.           else {
  1435. !             PutLine1 (LINES-2, 0,
  1436. !                           /*
  1437. !                            *    Well it should be like this but...
  1438. !                   catgets (elm_msg_cat, ElmSet, ElmConfirmFiles,
  1439. !                    "Append to an existing file `%s'? (y/n) n"),
  1440. !                            */
  1441. !                   is_ordinary_file
  1442. !                   ? "Append to an existing file `%s'? (y/n) n"
  1443. !                   : "Append to mail folder `%s'? (y/n) n",
  1444. !                   savename);
  1445. !             ch = ReadCh ();
  1446. !             ch = tolower (ch);
  1447. !             PutLine2 (LINES-2, 0,
  1448. !                   is_ordinary_file
  1449. !                   ? "Append to an existing file `%s'? (y/n) %s"
  1450. !                   : "Append to mail folder `%s'? (y/n) %s",
  1451. !                   savename,
  1452. !                   (ch == *def_ans_yes) ? "Yes" : "No");
  1453. !             sleep (1);
  1454. !             ClearLine (LINES-2);
  1455.   
  1456. !             if (ch != *def_ans_yes) {
  1457.               strcpy(savename, sent_mail);
  1458. !             PutLine1 (LINES-2, 0,
  1459. !                   "Alright - saving to `%s' instead",
  1460.                     savename);
  1461.               sleep (3);
  1462.               ClearLine (LINES-2);
  1463. --- 152,172 ----
  1464.               strcpy(savename, sent_mail);
  1465.           }
  1466.           else {
  1467. !             if (is_ordinary_file)
  1468. !               MCsprintf(msg_buffer, catgets(elm_msg_cat, ElmSet, ElmConfirmFilesAppend,
  1469. !               "Append to an existing file `%s'? (%c/%c) "),
  1470. !             filename, *def_ans_yes, *def_ans_no);
  1471. !             else
  1472. !               MCsprintf(msg_buffer, catgets(elm_msg_cat, ElmSet, ElmConfirmFolderAppend,
  1473. !               "Append to mail folder `%s'? (%c/%c) "),
  1474. !             filename, *def_ans_yes, *def_ans_no);
  1475.   
  1476. !             answer = want_to(buffer, *def_ans_no, LINES-2);
  1477. !             if (answer != *def_ans_yes) {
  1478.               strcpy(savename, sent_mail);
  1479. !             PutLine1 (LINES-2, 0, catgets(elm_msg_cat, ElmSet, ElmSavingToInstead,
  1480. !                   "Alright - saving to `%s' instead"),
  1481.                     savename);
  1482.               sleep (3);
  1483.               ClearLine (LINES-2);
  1484. ***************
  1485. *** 186,216 ****
  1486.               strcpy(savename, sent_mail);
  1487.           }
  1488.           else {
  1489. !             PutLine1 (LINES-2, 0,
  1490. !                           /*
  1491. !                            *    Well it should be like this but...
  1492. !                   catgets (elm_msg_cat, ElmSet, ElmConfirmFolders,
  1493. !                                     "Create a new mail folder `%s'? (y/n) n"),
  1494. !                            */
  1495. !                   !is_ordinary_file
  1496. !                   ? "Create a new mail folder `%s'? (y/n) n"
  1497. !                   : "Create a new file `%s'? (y/n) n",
  1498. !                   savename);
  1499. !             ch = ReadCh ();
  1500. !             ch = tolower (ch);
  1501. !             PutLine2 (LINES-2, 0,
  1502. !                   !is_ordinary_file
  1503. !                   ? "Create a new mail folder `%s'? (y/n) %s"
  1504. !                   : "Create a new file `%s'? (y/n) %s",
  1505. !                   savename,
  1506. !                   (ch == *def_ans_yes) ? "Yes" : "No");
  1507. !             sleep (1);
  1508. !             ClearLine (LINES-2);
  1509.   
  1510.               if (ch != *def_ans_yes) {
  1511.               strcpy(savename, sent_mail);
  1512. !             PutLine1 (LINES-2, 0,
  1513. !                   "Alright - saving to `%s' instead",
  1514.                     savename);
  1515.               sleep (3);
  1516.               ClearLine (LINES-2);
  1517. --- 185,205 ----
  1518.               strcpy(savename, sent_mail);
  1519.           }
  1520.           else {
  1521. !             if (is_ordinary_file)
  1522. !               MCsprintf(msg_buffer, catgets(elm_msg_cat, ElmSet, ElmConfirmFilesCreate,
  1523. !               "Create a new file `%s'? (%c/%c) "),
  1524. !             filename, *def_ans_yes, *def_ans_no);
  1525. !             else
  1526. !               MCsprintf(msg_buffer, catgets(elm_msg_cat, ElmSet, ElmConfirmFolderCreate,
  1527. !               "Create a new mail folder `%s'? (%c/%c) "),
  1528. !             filename, *def_ans_yes, *def_ans_no);
  1529. !             answer = want_to(buffer, *def_ans_no, LINES-2);
  1530.   
  1531.               if (ch != *def_ans_yes) {
  1532.               strcpy(savename, sent_mail);
  1533. !             PutLine1 (LINES-2, 0, catgets(elm_msg_cat, ElmSet, ElmSavingToInstead,
  1534. !                   "Alright - saving to `%s' instead"),
  1535.                     savename);
  1536.               sleep (3);
  1537.               ClearLine (LINES-2);
  1538.  
  1539. Index: src/strings.c
  1540. Prereq: 5.2
  1541. *** ../elm2.4/src/strings.c    Mon Oct 19 13:04:09 1992
  1542. --- src/strings.c    Thu Dec 24 17:17:05 1992
  1543. ***************
  1544. *** 1,8 ****
  1545.   
  1546. ! static char rcsid[] = "@(#)$Id: strings.c,v 5.2 1992/10/17 22:30:43 syd Exp $";
  1547.   
  1548.   /*******************************************************************************
  1549. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  1550.    *
  1551.    *             Copyright (c) 1986, 1987 Dave Taylor
  1552.    *             Copyright (c) 1988, 1989, 1990, 1991 USENET Community Trust
  1553. --- 1,8 ----
  1554.   
  1555. ! static char rcsid[] = "@(#)$Id: strings.c,v 5.3 1992/12/24 22:16:06 syd Exp $";
  1556.   
  1557.   /*******************************************************************************
  1558. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  1559.    *
  1560.    *             Copyright (c) 1986, 1987 Dave Taylor
  1561.    *             Copyright (c) 1988, 1989, 1990, 1991 USENET Community Trust
  1562. ***************
  1563. *** 14,19 ****
  1564. --- 14,23 ----
  1565.    *
  1566.    *******************************************************************************
  1567.    * $Log: strings.c,v $
  1568. +  * Revision 5.3  1992/12/24  22:16:06  syd
  1569. +  * Make copy_sans_escape expand tabs to prevent subject displays from getting messed up
  1570. +  * From: Syd via request from pgf@Cayman.COM (Paul Fox)
  1571. +  *
  1572.    * Revision 5.2  1992/10/17  22:30:43  syd
  1573.    * Force text arithimetic into unsigned for those systems
  1574.    * with signed chars
  1575. ***************
  1576. *** 59,68 ****
  1577.           format (e.g. ^(char value + 32))
  1578.       **/
  1579.   
  1580. !     register int i = 0, j = 0;
  1581.   
  1582.       while (i < len && j < len && source[i] != '\0') {
  1583. !       if (iscntrl(source[i]) && source[i] != '\t') {
  1584.            dest[j++] = '^';
  1585.            if (j < len)
  1586.           dest[j++] = source[i++] + 'A' - 1;
  1587. --- 63,77 ----
  1588.           format (e.g. ^(char value + 32))
  1589.       **/
  1590.   
  1591. !     register int i = 0, j = 0, n = 0;
  1592. !     extern int tabspacing;
  1593.   
  1594.       while (i < len && j < len && source[i] != '\0') {
  1595. !       if (source[i] == '\t') {
  1596. !          n = next_tab(j) - j;
  1597. !          while (n-- && j < len)
  1598. !          dest[j++] = ' ';
  1599. !       } else if (iscntrl(source[i])) {
  1600.            dest[j++] = '^';
  1601.            if (j < len)
  1602.           dest[j++] = source[i++] + 'A' - 1;
  1603.  
  1604. Index: src/syscall.c
  1605. Prereq: 5.5
  1606. *** ../elm2.4/src/syscall.c    Thu Dec 24 18:57:02 1992
  1607. --- src/syscall.c    Sun Dec 20 00:29:34 1992
  1608. ***************
  1609. *** 1,8 ****
  1610.   
  1611. ! static char rcsid[] = "@(#)$Id: syscall.c,v 5.5 1992/12/11 02:05:26 syd Exp $";
  1612.   
  1613.   /*******************************************************************************
  1614. !  *  The Elm Mail System  -  $Revision: 5.5 $   $State: Exp $
  1615.    *
  1616.    *            Copyright (c) 1988-1992 USENET Community Trust
  1617.    *            Copyright (c) 1986,1987 Dave Taylor
  1618. --- 1,8 ----
  1619.   
  1620. ! static char rcsid[] = "@(#)$Id: syscall.c,v 5.6 1992/12/20 05:29:33 syd Exp $";
  1621.   
  1622.   /*******************************************************************************
  1623. !  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
  1624.    *
  1625.    *            Copyright (c) 1988-1992 USENET Community Trust
  1626.    *            Copyright (c) 1986,1987 Dave Taylor
  1627. ***************
  1628. *** 14,19 ****
  1629. --- 14,25 ----
  1630.    *
  1631.    *******************************************************************************
  1632.    * $Log: syscall.c,v $
  1633. +  * Revision 5.6  1992/12/20  05:29:33  syd
  1634. +  * Fixed where when doing ! or | and ti/te is enabled, one doesn't see the
  1635. +  * "Press any key to return to ELM:" message. because the screens are
  1636. +  * switched before the message is printed.
  1637. +  * From: Jan Djarv <Jan.Djarv@sa.erisoft.se>
  1638. +  *
  1639.    * Revision 5.5  1992/12/11  02:05:26  syd
  1640.    * List_folder knew only about '=' but nothing about the rest
  1641.    * of [+=%] as one would have expected.
  1642. ***************
  1643. *** 103,112 ****
  1644.       SetXYLocation(0, 40);    /* a location not near the next request, so an absolute is used */
  1645.       PutLine0(LINES, 0, catgets(elm_msg_cat, ElmSet, ElmPressAnyKeyToReturn,
  1646.           "\n\nPress any key to return to ELM: "));
  1647. !     Raw(ON);
  1648.       (void) getchar();
  1649. !     if (old_raw == OFF)
  1650. !       Raw(OFF);
  1651.       softkeys_on();
  1652.       if (cursor_control)
  1653.         transmit_functions(ON);
  1654. --- 109,121 ----
  1655.       SetXYLocation(0, 40);    /* a location not near the next request, so an absolute is used */
  1656.       PutLine0(LINES, 0, catgets(elm_msg_cat, ElmSet, ElmPressAnyKeyToReturn,
  1657.           "\n\nPress any key to return to ELM: "));
  1658. !     Raw(ON | NO_TITE);
  1659.       (void) getchar();
  1660. !     printf("\r\n");
  1661. !     Raw(OFF | NO_TITE); /* Done even if old_raw == ON, to get ti/te right */
  1662. !     if (old_raw == ON)
  1663. !       Raw(ON);
  1664.       softkeys_on();
  1665.       if (cursor_control)
  1666.         transmit_functions(ON);
  1667. ***************
  1668. *** 345,353 ****
  1669.       SetXYLocation(0, 40);    /* a location not near the next request, so an absolute is used */
  1670.       PutLine0(LINES, 0, catgets(elm_msg_cat, ElmSet, ElmPressAnyKeyToReturn,
  1671.           "\n\nPress any key to return to ELM: "));
  1672. !     if (old_raw == ON)
  1673. !        Raw(ON);
  1674.       (void) getchar();
  1675.       if (cursor_control)  transmit_functions(ON);
  1676.   
  1677.       if (ret != 0)
  1678. --- 354,367 ----
  1679.       SetXYLocation(0, 40);    /* a location not near the next request, so an absolute is used */
  1680.       PutLine0(LINES, 0, catgets(elm_msg_cat, ElmSet, ElmPressAnyKeyToReturn,
  1681.           "\n\nPress any key to return to ELM: "));
  1682. !     Raw(ON | NO_TITE);
  1683.       (void) getchar();
  1684. +     printf("\r\n");
  1685. +     Raw(OFF | NO_TITE); /* Done even if old_raw == ON, to get ti/te right */
  1686. +     if (old_raw == ON)
  1687. +       Raw(ON);
  1688.       if (cursor_control)  transmit_functions(ON);
  1689.   
  1690.       if (ret != 0)
  1691.  
  1692. Index: src/utils.c
  1693. Prereq: 5.4
  1694. *** ../elm2.4/src/utils.c    Thu Dec 24 18:57:03 1992
  1695. --- src/utils.c    Mon Jan  4 22:40:45 1993
  1696. ***************
  1697. *** 1,8 ****
  1698.   
  1699. ! static char rcsid[] = "@(#)$Id: utils.c,v 5.4 1992/12/11 01:45:04 syd Exp $";
  1700.   
  1701.   /*******************************************************************************
  1702. !  *  The Elm Mail System  -  $Revision: 5.4 $   $State: Exp $
  1703.    *
  1704.    *            Copyright (c) 1988-1992 USENET Community Trust
  1705.    *            Copyright (c) 1986,1987 Dave Taylor
  1706. --- 1,8 ----
  1707.   
  1708. ! static char rcsid[] = "@(#)$Id: utils.c,v 5.6 1993/01/05 03:40:45 syd Exp $";
  1709.   
  1710.   /*******************************************************************************
  1711. !  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
  1712.    *
  1713.    *            Copyright (c) 1988-1992 USENET Community Trust
  1714.    *            Copyright (c) 1986,1987 Dave Taylor
  1715. ***************
  1716. *** 14,19 ****
  1717. --- 14,28 ----
  1718.    *
  1719.    *******************************************************************************
  1720.    * $Log: utils.c,v $
  1721. +  * Revision 5.6  1993/01/05  03:40:45  syd
  1722. +  * Protect TSTP for those systems without it.
  1723. +  * From: kevin@cfctech.cfc.com (Kevin Darcy)
  1724. +  *
  1725. +  * Revision 5.5  1992/12/24  22:05:11  syd
  1726. +  * Some OS's, especially ULTRIX create extra continue signals
  1727. +  * that confuse Elm on exit
  1728. +  * From: Syd via patch from Bob Mason
  1729. +  *
  1730.    * Revision 5.4  1992/12/11  01:45:04  syd
  1731.    * remove sys/types.h include, it is now included by defs.h
  1732.    * and this routine includes defs.h or indirectly includes defs.h
  1733. ***************
  1734. *** 150,155 ****
  1735. --- 159,178 ----
  1736.   
  1737.       char *mk_lockname();
  1738.   
  1739. + /*
  1740. +  *    some OS's get extra cont signal, so once this far into the
  1741. +  *    exit, ignore those signals (Especially Ultrix)
  1742. +  */
  1743. + #ifdef SIGTSTP
  1744. +     signal(SIGTSTP,SIG_IGN);
  1745. + #endif
  1746. + #ifdef SIGSTOP
  1747. +     signal(SIGSTOP,SIG_IGN);
  1748. + #endif
  1749. + #ifdef SIGCONT
  1750. +     signal(SIGCONT,SIG_IGN);
  1751. + #endif
  1752.       dprint(1, (debugfile,
  1753.        "\nERROR: Something dreadful is happening!  Taking emergency exit!!\n\n"));
  1754.       dprint(1, (debugfile,
  1755. ***************
  1756. *** 176,202 ****
  1757.   }
  1758.   rm_temps_exit()
  1759.   {
  1760. !       char buffer[SLEN];
  1761. !       int do_cursor = RawState();
  1762.   
  1763. !       PutLine0(LINES, 0, catgets(elm_msg_cat, ElmSet, ElmWriteFailedExitingIntact,
  1764. !          "\nWrite to temp file failed, exiting leaving mailbox intact!\n\n"));
  1765. !       dprint(2, (debugfile, "\nrm_temps_exit, deleteing temp files\n"));
  1766. !       if (cursor_control)  transmit_functions(OFF);
  1767. !       if (hp_terminal)     softkeys_off();
  1768. !       sprintf(buffer,"%s%d",temp_file, getpid());  /* editor buffer */
  1769. !       (void) unlink(buffer);
  1770. !       if (folder_type == SPOOL) {
  1771. !         (void) unlink(cur_tempfolder);
  1772. !       }
  1773. !       unlock();                               /* remove lock file if any */
  1774. !       if(do_cursor) {
  1775. !         MoveCursor(LINES,0);
  1776. !         NewLine();
  1777. !         Raw(OFF);
  1778. !       }
  1779. !       exit(1);
  1780.   }
  1781.   
  1782.   /*ARGSUSED*/
  1783. --- 199,244 ----
  1784.   }
  1785.   rm_temps_exit()
  1786.   {
  1787. !     char buffer[SLEN];
  1788. !     int do_cursor = RawState();
  1789. ! /*
  1790. !  *    some OS's get extra cont signal, so once this far into the
  1791. !  *    exit, ignore those signals (Especially Ultrix)
  1792. !  */
  1793. ! #ifdef SIGTSTP
  1794. !     signal(SIGTSTP,SIG_IGN);
  1795. ! #endif
  1796. ! #ifdef SIGSTOP
  1797. !     signal(SIGSTOP,SIG_IGN);
  1798. ! #endif
  1799. ! #ifdef SIGCONT
  1800. !     signal(SIGCONT,SIG_IGN);
  1801. ! #endif
  1802. !     PutLine0(LINES, 0, catgets(elm_msg_cat, ElmSet, ElmWriteFailedExitingIntact,
  1803. !      "\nWrite to temp file failed, exiting leaving mailbox intact!\n\n"));
  1804. !     dprint(2, (debugfile, "\nrm_temps_exit, deleteing temp files\n"));
  1805. !     if (cursor_control)  transmit_functions(OFF);
  1806. !     if (hp_terminal)     softkeys_off();
  1807. !     sprintf(buffer,"%s%d",temp_file, getpid());  /* editor buffer */
  1808. !     (void) unlink(buffer);
  1809. !     if (folder_type == SPOOL) {
  1810. !         (void) unlink(cur_tempfolder);
  1811. !     }
  1812. !     unlock();                               /* remove lock file if any */
  1813. !     if(do_cursor) {
  1814. !         MoveCursor(LINES,0);
  1815. !         NewLine();
  1816. !         Raw(OFF);
  1817. !     }
  1818.   
  1819. !     exit(1);
  1820.   }
  1821.   
  1822.   /*ARGSUSED*/
  1823. ***************
  1824. *** 208,213 ****
  1825. --- 250,269 ----
  1826.       char buffer[SLEN];
  1827.       int do_cursor = RawState();
  1828.   
  1829. + /*
  1830. +  *    some OS's get extra cont signal, so once this far into the
  1831. +  *    exit, ignore those signals (Especially Ultrix)
  1832. +  */
  1833. + #ifdef SIGTSTP
  1834. +     signal(SIGTSTP,SIG_IGN);
  1835. + #endif
  1836. + #ifdef SIGSTOP
  1837. +     signal(SIGSTOP,SIG_IGN);
  1838. + #endif
  1839. + #ifdef SIGCONT
  1840. +     signal(SIGCONT,SIG_IGN);
  1841. + #endif
  1842.       dprint(2, (debugfile, "\nLeaving mailer normally (leave)\n"));
  1843.   
  1844.       if (cursor_control)  transmit_functions(OFF);
  1845. ***************
  1846. *** 240,245 ****
  1847. --- 296,315 ----
  1848.       char buffer[SLEN];
  1849.       int do_cursor = RawState();
  1850.   
  1851. + /*
  1852. +  *    some OS's get extra cont signal, so once this far into the
  1853. +  *    exit, ignore those signals (Especially Ultrix)
  1854. +  */
  1855. + #ifdef SIGTSTP
  1856. +     signal(SIGTSTP,SIG_IGN);
  1857. + #endif
  1858. + #ifdef SIGSTOP
  1859. +     signal(SIGSTOP,SIG_IGN);
  1860. + #endif
  1861. + #ifdef SIGCONT
  1862. +     signal(SIGCONT,SIG_IGN);
  1863. + #endif
  1864.       dprint(2, (debugfile, "\nLeaving mailer quietly (silently_exit)\n"));
  1865.   
  1866.       if (cursor_control)  transmit_functions(OFF);
  1867. ***************
  1868. *** 267,272 ****
  1869. --- 337,356 ----
  1870.   
  1871.       char buffer[SLEN];
  1872.           int do_cursor = RawState();
  1873. + /*
  1874. +  *    some OS's get extra cont signal, so once this far into the
  1875. +  *    exit, ignore those signals (Especially Ultrix)
  1876. +  */
  1877. + #ifdef SIGTSTP
  1878. +     signal(SIGTSTP,SIG_IGN);
  1879. + #endif
  1880. + #ifdef SIGSTOP
  1881. +     signal(SIGSTOP,SIG_IGN);
  1882. + #endif
  1883. + #ifdef SIGCONT
  1884. +     signal(SIGCONT,SIG_IGN);
  1885. + #endif
  1886.   
  1887.           dprint(3, (debugfile,
  1888.           "\nLeaving mailer due to presence of lock file (leave_locked)\n"));
  1889.  
  1890. Index: utils/listalias.c
  1891. Prereq: 5.5
  1892. *** ../elm2.4/utils/listalias.c    Tue Nov 17 14:11:05 1992
  1893. --- utils/listalias.c    Sun Dec 20 00:16:02 1992
  1894. ***************
  1895. *** 1,8 ****
  1896.   
  1897. ! static char rcsid[] = "@(#)$Id: listalias.c,v 5.5 1992/11/15 01:24:34 syd Exp $";
  1898.   
  1899.   /*******************************************************************************
  1900. !  *  The Elm Mail System  -  $Revision: 5.5 $   $State: Exp $
  1901.    *
  1902.    *             Copyright (c) 1988-1992 USENET Community Trust
  1903.    *             Copyright (c) 1986,1987 Dave Taylor
  1904. --- 1,8 ----
  1905.   
  1906. ! static char rcsid[] = "@(#)$Id: listalias.c,v 5.6 1992/12/20 05:15:58 syd Exp $";
  1907.   
  1908.   /*******************************************************************************
  1909. !  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
  1910.    *
  1911.    *             Copyright (c) 1988-1992 USENET Community Trust
  1912.    *             Copyright (c) 1986,1987 Dave Taylor
  1913. ***************
  1914. *** 14,19 ****
  1915. --- 14,24 ----
  1916.    *
  1917.    *******************************************************************************
  1918.    * $Log: listalias.c,v $
  1919. +  * Revision 5.6  1992/12/20  05:15:58  syd
  1920. +  * Add a c)hange alias, -u and -t options to listalias to list only user
  1921. +  * and only system aliases respectively.
  1922. +  * From: "Robert L. Howard" <robert.howard@matd.gatech.edu>
  1923. +  *
  1924.    * Revision 5.5  1992/11/15  01:24:34  syd
  1925.    * The situation is that the .elm/aliases file is missing, but
  1926.    * .elm/aliases.dir and .elm/aliases.pag exist (isn't serendipity
  1927. ***************
  1928. *** 65,80 ****
  1929.   FILE *debugfile = stderr;
  1930.   #endif
  1931.   
  1932.   main(argc, argv)
  1933.   int argc;
  1934.   char *argv[];
  1935.   {
  1936. !     FILE *fd_pipe, *datafile;
  1937. !     DBZ *db;
  1938. !     struct alias_rec alias_entry;
  1939. !     int count = 0, len;
  1940. !     char buffer[VERY_LONG_STRING], fd_hash[SLEN], 
  1941. !          fd_data[SLEN], *home;
  1942.   
  1943.   #ifdef I_LOCALE
  1944.       setlocale(LC_ALL, "");
  1945. --- 70,90 ----
  1946.   FILE *debugfile = stderr;
  1947.   #endif
  1948.   
  1949. + static void usage();
  1950.   main(argc, argv)
  1951.   int argc;
  1952.   char *argv[];
  1953.   {
  1954. !     extern int optind;
  1955. !     FILE *fd_pipe;
  1956. !     int system = TRUE, user = TRUE;
  1957. !     int err_flag = 0;
  1958. !     char buffer[SLEN], fd_data[SLEN], *home;
  1959. !     char c;
  1960.   
  1961.   #ifdef I_LOCALE
  1962.       setlocale(LC_ALL, "");
  1963. ***************
  1964. *** 82,102 ****
  1965.   
  1966.       elm_msg_cat = catopen("elm2.4", 0);
  1967.   
  1968. !     if (argc > 2) {
  1969. !       fprintf(stderr, catgets(elm_msg_cat, NewaliasSet, NewaliasListUsage,
  1970. !         "Usage: listalias <optional-regular-expression>\n"));
  1971. !       exit(1);
  1972.       }
  1973.   
  1974. !     home = getenv("HOME");
  1975. !     sprintf(fd_data, "%s/%s", home, ALIAS_DATA);
  1976. !     if (argc > 1)
  1977. !       sprintf(buffer, "egrep \"%s\" | sort", argv[1]);
  1978.       else
  1979. !       sprintf(buffer, "sort");
  1980.   
  1981.       if ((fd_pipe = popen(buffer, "w")) == NULL) {
  1982.         if (argc > 1) 
  1983.           fprintf(stderr, catgets(elm_msg_cat, NewaliasSet, NewaliasNoPipe,
  1984. --- 92,125 ----
  1985.   
  1986.       elm_msg_cat = catopen("elm2.4", 0);
  1987.   
  1988. !     while ((c = getopt(argc, argv, "su")) != EOF) {
  1989. !         switch (c) {
  1990. !             case 's' :
  1991. !                 user = FALSE;
  1992. !                 if (system == FALSE)
  1993. !                     err_flag++;
  1994. !                 break;
  1995. !             case 'u' :
  1996. !                 system = FALSE;
  1997. !                 if (user == FALSE)
  1998. !                     err_flag++;
  1999. !                 break;
  2000. !             case '?' :
  2001. !                 err_flag++;
  2002. !          }
  2003. !     }    
  2004. !     if (err_flag) {
  2005. !         usage();
  2006.       }
  2007.   
  2008. !     if (optind < argc)
  2009. !         sprintf(buffer, "egrep \"%s\" | sort", argv[optind++]);
  2010.       else
  2011. !         sprintf(buffer, "sort");
  2012.   
  2013. +     if (optind < argc)
  2014. +         usage();
  2015.       if ((fd_pipe = popen(buffer, "w")) == NULL) {
  2016.         if (argc > 1) 
  2017.           fprintf(stderr, catgets(elm_msg_cat, NewaliasSet, NewaliasNoPipe,
  2018. ***************
  2019. *** 104,135 ****
  2020.         fd_pipe = stdout;
  2021.       }
  2022.   
  2023. !     do {
  2024. !         if ((db = dbz_open(fd_data, O_RDONLY, 0)) == NULL) {
  2025.               fprintf(stderr, catgets(elm_msg_cat, NewaliasSet,
  2026. !         NewaliasNoOpenData, "Could not open %s data file!\n"),
  2027. !     count? catgets(elm_msg_cat, NewaliasSet, NewaliasSystem, "system")
  2028. !          : catgets(elm_msg_cat, NewaliasSet, NewaliasUser, "user"));
  2029. !           goto next_file;
  2030.           }
  2031. !     
  2032. !         /** Otherwise let us continue... **/
  2033.   
  2034. !         datafile = db->dbz_basef;
  2035. !         while (get_one_alias(db, &alias_entry)) {
  2036. !         len = alias_entry.length;
  2037. !         fread(buffer, len > sizeof(buffer) ? sizeof(buffer) : len, 1, datafile);
  2038. !         alias_entry.alias += (int) buffer;
  2039. !         alias_entry.name += (int) buffer;
  2040. !         alias_entry.address += (int) buffer;
  2041. !         fprintf(fd_pipe, "%-20.20s %s (%s)\n", alias_entry.alias, alias_entry.address, alias_entry.name);
  2042. !         for (len -= sizeof(buffer); len > 0; len -= sizeof(buffer))
  2043. !             fread(buffer, len > sizeof(buffer) ? sizeof(buffer) : len, 1, datafile);
  2044.           }
  2045. ! next_file: strcpy(fd_data, system_data_file);
  2046. !     } while (++count < 2);
  2047.   
  2048.       pclose(fd_pipe);
  2049.   
  2050. --- 127,150 ----
  2051.         fd_pipe = stdout;
  2052.       }
  2053.   
  2054. !     if (user) {
  2055. !         home = getenv("HOME");
  2056. !         sprintf(fd_data, "%s/%s", home, ALIAS_DATA);
  2057. !         if (print_aliases(fd_data, fd_pipe) == -1) {
  2058.               fprintf(stderr, catgets(elm_msg_cat, NewaliasSet,
  2059. !           NewaliasNoOpenData, "Could not open %s data file!\n"),
  2060. !               catgets(elm_msg_cat, NewaliasSet, NewaliasUser, "user"));
  2061.           }
  2062. !     }
  2063.   
  2064. !     if (system) {
  2065. !         strcpy(fd_data, system_data_file);
  2066. !         if (print_aliases(fd_data, fd_pipe) == -1) {
  2067. !             fprintf(stderr, catgets(elm_msg_cat, NewaliasSet,
  2068. !           NewaliasNoOpenData, "Could not open %s data file!\n"),
  2069. !               catgets(elm_msg_cat, NewaliasSet, NewaliasSystem, "system"));
  2070.           }
  2071. !     }
  2072.   
  2073.       pclose(fd_pipe);
  2074.   
  2075. ***************
  2076. *** 136,189 ****
  2077.       exit(0);
  2078.   }
  2079.   
  2080. ! /* byte-ordering stuff */
  2081. ! #define    MAPIN(o)    ((db->dbz_bytesame) ? (of_t) (o) : bytemap((of_t)(o), db->dbz_conf.bytemap, db->dbz_mybmap))
  2082. ! #define    MAPOUT(o)    ((db->dbz_bytesame) ? (of_t) (o) : bytemap((of_t)(o), db->dbz_mybmap, db->dbz_conf.bytemap))
  2083. ! static of_t            /* transformed result */
  2084. ! bytemap(ino, map1, map2)
  2085. ! of_t ino;
  2086. ! int *map1;
  2087. ! int *map2;
  2088.   {
  2089. -     union oc {
  2090. -         of_t o;
  2091. -         char c[SOF];
  2092. -     };
  2093. -     union oc in;
  2094. -     union oc out;
  2095. -     register int i;
  2096. -     in.o = ino;
  2097. -     for (i = 0; i < SOF; i++)
  2098. -         out.c[map2[i]] = in.c[map1[i]];
  2099. -     return(out.o);
  2100. - }
  2101.   
  2102. ! get_one_alias(db, ar)
  2103. ! DBZ *db;
  2104. ! struct alias_rec *ar;
  2105. ! {
  2106. ! /*
  2107. !  *    Get an alias (name, address, etc.) from the data file
  2108. !  */
  2109.   
  2110. !     FILE *data_file = db->dbz_basef;
  2111.   
  2112. !     if (data_file == NULL)
  2113. !         return(0);    /* no alias file, but hash exists, error condition */
  2114.   
  2115. !     if (fread((char *) ar, sizeof(struct alias_rec), 1, data_file) <= 0)
  2116. !         return(0);
  2117.   
  2118. !     ar->status = (int) MAPIN(ar->status);
  2119. !     ar->alias = (char *) MAPIN(ar->alias);
  2120. !     ar->last_name = (char *) MAPIN(ar->last_name);
  2121. !     ar->name = (char *) MAPIN(ar->name);
  2122. !     ar->comment = (char *) MAPIN(ar->comment);
  2123. !     ar->address = (char *) MAPIN(ar->address);
  2124. !     ar->type = (int) MAPIN(ar->type);
  2125. !     ar->length = (long) MAPIN(ar->length);
  2126.   
  2127. !     return(1);
  2128.   }
  2129. --- 151,195 ----
  2130.       exit(0);
  2131.   }
  2132.   
  2133. ! int
  2134. ! print_aliases(fd_data, fd_pipe)
  2135. ! char *fd_data;
  2136. ! FILE *fd_pipe;
  2137.   {
  2138.   
  2139. !     FILE *datafile;
  2140. !     DBZ *db;
  2141. !     struct alias_rec alias_entry;
  2142. !     int len;
  2143.   
  2144. !     char buffer[VERY_LONG_STRING];
  2145.   
  2146. !     if ((db = dbz_open(fd_data, O_RDONLY, 0)) == NULL) {
  2147. !         return(-1);
  2148. !     }
  2149. !     
  2150. !     /** Otherwise let us continue... **/
  2151.   
  2152. !     datafile = db->dbz_basef;
  2153. !     while (read_one_alias(db, &alias_entry)) {
  2154. !         len = alias_entry.length;
  2155. !         fread(buffer,
  2156. !         len > sizeof(buffer) ? sizeof(buffer) : len, 1, datafile);
  2157. !         alias_entry.alias += (int) buffer;
  2158. !         alias_entry.name += (int) buffer;
  2159. !         alias_entry.address += (int) buffer;
  2160. !         fprintf(fd_pipe, "%-20.20s %s (%s)\n",
  2161. !         alias_entry.alias, alias_entry.address, alias_entry.name);
  2162. !         for (len -= sizeof(buffer); len > 0; len -= sizeof(buffer))
  2163. !             fread(buffer,
  2164. !             len > sizeof(buffer) ? sizeof(buffer) : len, 1, datafile);
  2165. !     }
  2166.   
  2167. ! }
  2168.   
  2169. ! static void usage()
  2170. ! {
  2171. !     fprintf(stderr, catgets(elm_msg_cat, NewaliasSet, NewaliasListUsage,
  2172. !         "Usage: listalias [ -s | -u ] <optional-regular-expression>\n"));
  2173. !     exit(1);
  2174.   }
  2175.  
  2176. Index: src/a_quit.c
  2177. Prereq: 5.2
  2178. *** ../elm2.4/src/a_quit.c    Thu Dec 24 18:56:46 1992
  2179. --- src/a_quit.c    Thu Dec 24 16:42:06 1992
  2180. ***************
  2181. *** 1,8 ****
  2182.   
  2183. ! static char rcsid[] = "@(#)$Id: a_quit.c,v 5.2 1992/12/11 02:09:06 syd Exp $";
  2184.   
  2185.   /*******************************************************************************
  2186. !  *  The Elm Mail System  -  $Revision: 5.2 $   $State: Exp $
  2187.    *
  2188.    *             Copyright (c) 1988-1992 USENET Community Trust
  2189.    *             Copyright (c) 1986,1987 Dave Taylor
  2190. --- 1,8 ----
  2191.   
  2192. ! static char rcsid[] = "@(#)$Id: a_quit.c,v 5.3 1992/12/24 21:42:01 syd Exp $";
  2193.   
  2194.   /*******************************************************************************
  2195. !  *  The Elm Mail System  -  $Revision: 5.3 $   $State: Exp $
  2196.    *
  2197.    *             Copyright (c) 1988-1992 USENET Community Trust
  2198.    *             Copyright (c) 1986,1987 Dave Taylor
  2199. ***************
  2200. *** 14,19 ****
  2201. --- 14,24 ----
  2202.    *
  2203.    *******************************************************************************
  2204.    * $Log: a_quit.c,v $
  2205. +  * Revision 5.3  1992/12/24  21:42:01  syd
  2206. +  * Fix messages and nls messages to match.  Plus use want_to
  2207. +  * where appropriate.
  2208. +  * From: Syd, via prompting from Jan Djarv <Jan.Djarv@sa.erisoft.se>
  2209. +  *
  2210.    * Revision 5.2  1992/12/11  02:09:06  syd
  2211.    * Fix where the user creates a first new alias, then deletes it, the
  2212.    * alias stays on screen, but the file really will be empty if it was the
  2213. ***************
  2214. *** 101,107 ****
  2215.               "Delete %d aliases? (%c/%c) "),
  2216.               marked_deleted, *def_ans_yes, *def_ans_no);
  2217.                           
  2218. !         answer = want_to(buffer, answer);
  2219.         }
  2220.   
  2221.         if(answer == *def_ans_yes) {
  2222. --- 106,112 ----
  2223.               "Delete %d aliases? (%c/%c) "),
  2224.               marked_deleted, *def_ans_yes, *def_ans_no);
  2225.                           
  2226. !         answer = want_to(buffer, answer, LINES-3);
  2227.         }
  2228.   
  2229.         if(answer == *def_ans_yes) {
  2230.  
  2231. Index: lib/mk_aliases.c
  2232. Prereq: 5.6
  2233. *** ../elm2.4/lib/mk_aliases.c    Thu Dec 24 18:56:45 1992
  2234. --- lib/mk_aliases.c    Tue Jan  5 12:52:14 1993
  2235. ***************
  2236. *** 1,8 ****
  2237.   
  2238. ! static char rcsid[] = "@(#)$Id: mk_aliases.c,v 5.6 1992/12/11 02:10:24 syd Exp $";
  2239.   
  2240.   /*******************************************************************************
  2241. !  *  The Elm Mail System  -  $Revision: 5.6 $   $State: Exp $
  2242.    *
  2243.    *            Copyright (c) 1988-1992 USENET Community Trust
  2244.    *            Copyright (c) 1986,1987 Dave Taylor
  2245. --- 1,8 ----
  2246.   
  2247. ! static char rcsid[] = "@(#)$Id: mk_aliases.c,v 5.7 1993/01/05 17:52:14 syd Exp $";
  2248.   
  2249.   /*******************************************************************************
  2250. !  *  The Elm Mail System  -  $Revision: 5.7 $   $State: Exp $
  2251.    *
  2252.    *            Copyright (c) 1988-1992 USENET Community Trust
  2253.    *            Copyright (c) 1986,1987 Dave Taylor
  2254. ***************
  2255. *** 14,19 ****
  2256. --- 14,23 ----
  2257.    *
  2258.    *******************************************************************************
  2259.    * $Log: mk_aliases.c,v $
  2260. +  * Revision 5.7  1993/01/05  17:52:14  syd
  2261. +  * Add missing quote check to whitespace error check loop
  2262. +  * From: "Robert L. Howard" <robert.howard@matd.gatech.edu>
  2263. +  *
  2264.    * Revision 5.6  1992/12/11  02:10:24  syd
  2265.    * Make Elm complain about spaces that are not after commas in
  2266.    * alias and address lists
  2267. ***************
  2268. *** 414,420 ****
  2269.           if (*s == '\\') {
  2270.           s++;
  2271.           continue;
  2272. !         }
  2273.   
  2274.           if (*s == '"')
  2275.           in_quote = !in_quote;
  2276. --- 418,424 ----
  2277.           if (*s == '\\') {
  2278.           s++;
  2279.           continue;
  2280. !         }
  2281.   
  2282.           if (*s == '"')
  2283.           in_quote = !in_quote;
  2284. ***************
  2285. *** 438,444 ****
  2286.           return;
  2287.       }
  2288.   
  2289. -     addresses = s + 1;            /* REDUNDANT !?!?! */
  2290.   /*
  2291.    *    Remove trailing whitespace from second field
  2292.    */
  2293. --- 442,447 ----
  2294. ***************
  2295. *** 489,505 ****
  2296.   /*
  2297.    *    Now strip out any whitespace (and make sure it was
  2298.    *    legal whitespace).  Legal whitespace follows ','.
  2299.    */
  2300.       for (s = addresses, out = addresses; *s; s++) {
  2301. !         if (whitespace(*s)) {
  2302. !             if (*(out-1) != ',') {
  2303.                   err_flag++;            /* Keep going for now */
  2304. -             *out++ = *s;
  2305.               }
  2306.           }
  2307. !         else {
  2308. !         *out++ = *s;
  2309. !         }
  2310.       }
  2311.       *out = '\0';
  2312.   
  2313. --- 492,513 ----
  2314.   /*
  2315.    *    Now strip out any whitespace (and make sure it was
  2316.    *    legal whitespace).  Legal whitespace follows ','.
  2317. +  *    Don't mess with white space in quotes.
  2318.    */
  2319. +     in_quote = FALSE;            /* Just for safety */
  2320.       for (s = addresses, out = addresses; *s; s++) {
  2321. !         if (*s == '"')
  2322. !         in_quote = !in_quote;
  2323. !         if (!in_quote && whitespace(*s)) {
  2324. !             if (*(out-1) == ',') {
  2325. !                 continue;
  2326. !             }
  2327. !             else {
  2328.                   err_flag++;            /* Keep going for now */
  2329.               }
  2330.           }
  2331. !         *out++ = *s;
  2332.       }
  2333.       *out = '\0';
  2334.   
  2335.  
  2336. -- 
  2337. ========================================================================
  2338. Sydney S. Weinstein, CDP, CCP          Elm Coordinator - Current 2.4PL20
  2339. Datacomp Systems, Inc.                 Projected 3.0 Release: ??? ?,1994
  2340. syd@DSI.COM or dsinc!syd      Voice: (215) 947-9900, FAX: (215) 938-0235
  2341.