Subject: elm 2.4 Patch #23e
Summary: This is an official patch for elm 2.4 system. Please apply it.
Priority: HIGH
THIS IS PART 5 OF A 5 PART PATCH
Fix: From rn, say "| patch -p -N -d DIR", where DIR is your elm source
directory. Outside of rn, say "cd DIR; patch -p -N <thisarticle".
If you don't have the patch program, apply the following by hand,
or get patch (version 2.0, latest patchlevel).
After patching:
sh Configure
make
make install
If patch indicates that patchlevel is the wrong version, you may need
to apply one or more previous patches, or the patch may already
have been applied. See the patchlevel.h file to find out what has or
has not been applied. In any event, don't continue with the patch.
If you are missing previous patches they can be obtained from our:
archive server.
Syd Weinstein
[email protected]
The patches are available from the dsinc archive server
Send the following message to
[email protected] for
a list of available patches:
Subject: patch list
send index elm
Index: src/showmsg.c
Prereq: 5.13
*** ../elm2.4/src/showmsg.c Sat May 8 16:25:51 1993
--- src/showmsg.c Sun Aug 22 22:46:09 1993
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: showmsg.c,v 5.13 1993/05/08 20:25:33 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.13 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: showmsg.c,v 5.15 1993/08/23 02:46:07 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.15 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,35 ----
*
*******************************************************************************
* $Log: showmsg.c,v $
+ * Revision 5.15 1993/08/23 02:46:07 syd
+ * Don't declare _exit() if <unistd.h> already did it.
+ * From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
+ *
+ * Revision 5.14 1993/08/03 19:28:39 syd
+ * Elm tries to replace the system toupper() and tolower() on current
+ * BSD systems, which is unnecessary. Even worse, the replacements
+ * collide during linking with routines in isctype.o. This patch adds
+ * a Configure test to determine whether replacements are really needed
+ * (BROKE_CTYPE definition). The <ctype.h> header file is now included
+ * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
+ * there. Inclusion of <ctype.h> was removed from *all* the individual
+ * files, and the toupper() and tolower() routines in lib/opt_utils.c
+ * were dropped.
+ * From:
[email protected] (Chip Rosenthal)
+ *
* Revision 5.13 1993/05/08 20:25:33 syd
* Add sleepmsg to control transient message delays
* From: Syd
***************
*** 85,102 ****
#include "headers.h"
#include "s_elm.h"
- #include <ctype.h>
#include <errno.h>
#ifdef BSD
# include <sys/wait.h>
! # undef tolower
#endif
extern int errno;
extern char *elm_date_str(), *error_description();
- void _exit();
int memory_lock = FALSE; /* is it available?? */
int pipe_abort = FALSE; /* did we receive a SIGNAL(SIGPIPE)? */
--- 101,119 ----
#include "headers.h"
#include "s_elm.h"
#include <errno.h>
#ifdef BSD
# include <sys/wait.h>
! #endif
!
! #ifndef I_UNISTD
! void _exit();
#endif
extern int errno;
extern char *elm_date_str(), *error_description();
int memory_lock = FALSE; /* is it available?? */
int pipe_abort = FALSE; /* did we receive a SIGNAL(SIGPIPE)? */
Index: src/signals.c
Prereq: 5.8
*** ../elm2.4/src/signals.c Sun Apr 11 23:04:59 1993
--- src/signals.c Tue Aug 3 15:10:51 1993
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: signals.c,v 5.8 1993/04/12 03:04:58 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.8 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: signals.c,v 5.9 1993/08/03 19:10:50 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.9 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,26 ----
*
*******************************************************************************
* $Log: signals.c,v $
+ * Revision 5.9 1993/08/03 19:10:50 syd
+ * Patch for Elm 2.4 PL22 to correct handling of SIGWINCH signals on
+ * DecStations with Ultrix 4.2.
+ * The problem was that elm running in an xterm exits silently when the
+ * window is resize. This was caused by incorrect signal handling for BSD.
+ * From:
[email protected]
+ *
* Revision 5.8 1993/04/12 03:04:58 syd
* The USR2 signal lost messages on some OS:es and did an unnecessary resync
* on others.
***************
*** 201,210 ****
SIGHAND_TYPE
winch_signal(sig)
{
#ifndef BSD
signal(SIGWINCH, winch_signal);
#endif
- resize_screen = 1;
}
#endif
--- 208,220 ----
SIGHAND_TYPE
winch_signal(sig)
{
+ resize_screen = 1;
#ifndef BSD
signal(SIGWINCH, winch_signal);
+ #else
+ if (InGetPrompt)
+ longjmp(GetPromptBuf, 1);
#endif
}
#endif
Index: src/string2.c
Prereq: 5.1
*** ../elm2.4/src/string2.c Sat Oct 3 18:59:20 1992
--- src/string2.c Tue Aug 3 15:29:21 1993
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: string2.c,v 5.1 1992/10/03 22:58:40 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.1 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: string2.c,v 5.2 1993/08/03 19:28:39 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.2 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,31 ----
*
*******************************************************************************
* $Log: string2.c,v $
+ * Revision 5.2 1993/08/03 19:28:39 syd
+ * Elm tries to replace the system toupper() and tolower() on current
+ * BSD systems, which is unnecessary. Even worse, the replacements
+ * collide during linking with routines in isctype.o. This patch adds
+ * a Configure test to determine whether replacements are really needed
+ * (BROKE_CTYPE definition). The <ctype.h> header file is now included
+ * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
+ * there. Inclusion of <ctype.h> was removed from *all* the individual
+ * files, and the toupper() and tolower() routines in lib/opt_utils.c
+ * were dropped.
+ * From:
[email protected] (Chip Rosenthal)
+ *
* Revision 5.1 1992/10/03 22:58:40 syd
* Initial checkin as of 2.4 Release at PL0
*
***************
*** 26,37 ****
**/
#include "headers.h"
- #include <ctype.h>
-
- #ifdef BSD
- #undef tolower
- #undef toupper
- #endif
int
--- 38,43 ----
Index: src/strings.c
Prereq: 5.6
*** ../elm2.4/src/strings.c Tue Jan 19 22:02:41 1993
--- src/strings.c Tue Aug 3 15:29:23 1993
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: strings.c,v 5.6 1993/01/20 03:02:19 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.6 $ $State: Exp $
*
* Copyright (c) 1986, 1987 Dave Taylor
* Copyright (c) 1988, 1989, 1990, 1991 USENET Community Trust
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: strings.c,v 5.8 1993/08/03 19:28:39 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.8 $ $State: Exp $
*
* Copyright (c) 1986, 1987 Dave Taylor
* Copyright (c) 1988, 1989, 1990, 1991 USENET Community Trust
***************
*** 14,19 ****
--- 14,35 ----
*
*******************************************************************************
* $Log: strings.c,v $
+ * Revision 5.8 1993/08/03 19:28:39 syd
+ * Elm tries to replace the system toupper() and tolower() on current
+ * BSD systems, which is unnecessary. Even worse, the replacements
+ * collide during linking with routines in isctype.o. This patch adds
+ * a Configure test to determine whether replacements are really needed
+ * (BROKE_CTYPE definition). The <ctype.h> header file is now included
+ * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
+ * there. Inclusion of <ctype.h> was removed from *all* the individual
+ * files, and the toupper() and tolower() routines in lib/opt_utils.c
+ * were dropped.
+ * From:
[email protected] (Chip Rosenthal)
+ *
+ * Revision 5.7 1993/07/20 02:26:58 syd
+ * Fix copy_sans_escape handling of tabs
+ * From: Syd via code from G A Smant
+ *
* Revision 5.6 1993/01/20 03:02:19 syd
* Move string declarations to defs.h
* From: Syd
***************
*** 55,67 ****
#include "headers.h"
#include "s_elm.h"
- #include <ctype.h>
- #ifdef BSD
- #undef tolower
- #undef toupper
- #endif
-
/** forward declarations **/
char *format_long(), *strip_commas(), *tail_of_string(),
--- 71,77 ----
***************
*** 81,89 ****
while (i < len && j < len && source[i] != '\0') {
if (source[i] == '\t') {
! n = next_tab(j) - j;
while (n-- && j < len)
dest[j++] = ' ';
} else if (iscntrl(source[i])) {
dest[j++] = '^';
if (j < len)
--- 91,100 ----
while (i < len && j < len && source[i] != '\0') {
if (source[i] == '\t') {
! n = (next_tab(j) - j) - 1;
while (n-- && j < len)
dest[j++] = ' ';
+ i++;
} else if (iscntrl(source[i])) {
dest[j++] = '^';
if (j < len)
***************
*** 200,209 ****
break;
while (--len >= 0) {
! if (islower(*buffer))
! *first = *buffer;
! else
! *first = tolower(*buffer);
buffer++;
first++;
}
--- 211,217 ----
break;
while (--len >= 0) {
! *first = tolower(*buffer);
buffer++;
first++;
}
***************
*** 219,228 ****
*/
for (; *buffer; buffer++, rest++)
! if (islower(*buffer))
! *rest = *buffer;
! else
! *rest = tolower(*buffer);
*rest = '\0';
--- 227,233 ----
*/
for (; *buffer; buffer++, rest++)
! *rest = tolower(*buffer);
*rest = '\0';
Index: src/syscall.c
Prereq: 5.7
*** ../elm2.4/src/syscall.c Sat May 8 16:25:52 1993
--- src/syscall.c Sun Aug 22 22:46:10 1993
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: syscall.c,v 5.7 1993/01/20 03:48:08 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.7 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: syscall.c,v 5.8 1993/08/23 02:46:07 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.8 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,23 ****
*
*******************************************************************************
* $Log: syscall.c,v $
! * Revision 5.7 1993/01/20 03:48:08 syd
! * Fix not to use vfork if SY_ENV_SHELL is set, as this causes the
! * parent environment to be modified.
! * From: Syd
*
* Revision 5.7 1993/01/20 03:48:08 syd
* Fix not to use vfork if SY_ENV_SHELL is set, as this causes the
--- 14,22 ----
*
*******************************************************************************
* $Log: syscall.c,v $
! * Revision 5.8 1993/08/23 02:46:07 syd
! * Don't declare _exit() if <unistd.h> already did it.
! * From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
*
* Revision 5.7 1993/01/20 03:48:08 syd
* Fix not to use vfork if SY_ENV_SHELL is set, as this causes the
***************
*** 69,76 ****
# include <sys/wait.h>
#endif
char *argv_zero();
- void _exit();
#ifdef ALLOW_SUBSHELL
--- 68,78 ----
# include <sys/wait.h>
#endif
+ #ifndef I_UNISTD
+ void _exit();
+ #endif
+
char *argv_zero();
#ifdef ALLOW_SUBSHELL
Index: src/utils.c
Prereq: 5.10
*** ../elm2.4/src/utils.c Sun Apr 11 23:11:50 1993
--- src/utils.c Sun Sep 26 21:52:09 1993
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: utils.c,v 5.10 1993/04/12 03:11:50 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.10 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: utils.c,v 5.15 1993/09/27 01:51:38 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.15 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,50 ----
*
*******************************************************************************
* $Log: utils.c,v $
+ * Revision 5.15 1993/09/27 01:51:38 syd
+ * Add elm_chown to consolidate for Xenix not allowing -1
+ * From: Syd
+ *
+ * Revision 5.14 1993/09/20 19:21:12 syd
+ * make fflush conditional on the unit being open
+ * From: Syd
+ *
+ * Revision 5.13 1993/09/19 23:37:29 syd
+ * I found a few places more where the code was missing a call
+ * to fflush() before it called unlock() and fclose()/exit()
+ * right after unlocking the mail drop.
+ * From: Jukka Ukkonen <
[email protected]>
+ *
+ * Revision 5.12 1993/08/23 03:26:24 syd
+ * Try setting group id separate from user id in chown to
+ * allow restricted systems to change group id of file
+ * From: Syd
+ *
+ * Revision 5.11 1993/08/03 19:28:39 syd
+ * Elm tries to replace the system toupper() and tolower() on current
+ * BSD systems, which is unnecessary. Even worse, the replacements
+ * collide during linking with routines in isctype.o. This patch adds
+ * a Configure test to determine whether replacements are really needed
+ * (BROKE_CTYPE definition). The <ctype.h> header file is now included
+ * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
+ * there. Inclusion of <ctype.h> was removed from *all* the individual
+ * files, and the toupper() and tolower() routines in lib/opt_utils.c
+ * were dropped.
+ * From:
[email protected] (Chip Rosenthal)
+ *
* Revision 5.10 1993/04/12 03:11:50 syd
* nameof() didn't check that the character after the common string was /, thus
* (if Mail is the folderdir) Maildir/x was made to be =dir/x.
***************
*** 69,81 ****
#include "headers.h"
#include "s_elm.h"
#include <sys/stat.h>
- #include <ctype.h>
#include <errno.h>
- #ifdef BSD
- #undef tolower
- #endif
-
extern int errno;
create_new_folders()
--- 100,107 ----
***************
*** 95,101 ****
(void) system_call(com, 0);
#endif /* MKDIR */
! chown(folders, userid, groupid);
}
create_new_elmdir()
--- 121,127 ----
(void) system_call(com, 0);
#endif /* MKDIR */
! (void) elm_chown(folders, userid, groupid);
}
create_new_elmdir()
***************
*** 118,124 ****
(void) system_call(com, 0);
#endif /* MKDIR */
! chown( source, userid, groupid);
}
move_old_files_to_new()
--- 144,150 ----
(void) system_call(com, 0);
#endif /* MKDIR */
! (void) elm_chown( source, userid, groupid);
}
move_old_files_to_new()
***************
*** 311,316 ****
--- 337,345 ----
(void) unlink(cur_tempfolder);
}
+ if (mailfile)
+ fflush (mailfile);
+
unlock(); /* remove lock file if any */
if (do_cursor) {
***************
*** 359,364 ****
--- 388,397 ----
Raw(OFF);
}
+ if (mailfile)
+ fflush (mailfile);
+ unlock ();
+
exit(0);
}
***************
*** 398,403 ****
--- 431,439 ----
(void) unlink(cur_tempfolder); /* temp mailbox */
+ if (mailfile)
+ fflush (mailfile);
+
if (do_cursor) {
MoveCursor(LINES,0);
NewLine();
***************
*** 479,481 ****
--- 515,533 ----
return( (char *) buffer);
}
+
+ int elm_chown(file, userid, groupid)
+ char *file;
+ int userid, groupid;
+ {
+ #ifdef CHOWN_NEG1
+ int status;
+
+ status = chown(file, -1, groupid);
+ chown(file, userid, -1);
+
+ return(status);
+ #else
+ return(chown(file, userid, groupid));
+ #endif
+ }
Index: src/wordwrap.c
Prereq: 5.4
*** ../elm2.4/src/wordwrap.c Sun Apr 11 23:02:40 1993
--- src/wordwrap.c Tue Aug 3 15:29:25 1993
***************
*** 1,5 ****
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.4 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
+
+ static char rcsid[] = "@(#)$Id: wordwrap.c,v 5.6 1993/08/03 19:28:39 syd Exp $";
+
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.6 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
***************
*** 11,16 ****
--- 14,35 ----
*
*******************************************************************************
* $Log: wordwrap.c,v $
+ * Revision 5.6 1993/08/03 19:28:39 syd
+ * Elm tries to replace the system toupper() and tolower() on current
+ * BSD systems, which is unnecessary. Even worse, the replacements
+ * collide during linking with routines in isctype.o. This patch adds
+ * a Configure test to determine whether replacements are really needed
+ * (BROKE_CTYPE definition). The <ctype.h> header file is now included
+ * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
+ * there. Inclusion of <ctype.h> was removed from *all* the individual
+ * files, and the toupper() and tolower() routines in lib/opt_utils.c
+ * were dropped.
+ * From:
[email protected] (Chip Rosenthal)
+ *
+ * Revision 5.5 1993/06/10 03:12:10 syd
+ * Add missing rcs id lines
+ * From: Syd
+ *
* Revision 5.4 1993/04/12 03:02:40 syd
* Check for EINTR if getchar() returns EOF. Happens after a resume from an
* interactive stop.
***************
*** 42,52 ****
#include "headers.h"
#include <errno.h>
- #include <ctype.h>
-
- #ifdef BSD
- # undef tolower
- #endif
extern int errno; /* system error number */
--- 61,66 ----
Index: utils/answer.c
Prereq: 5.5
*** ../elm2.4/utils/answer.c Thu Feb 4 10:32:52 1993
--- utils/answer.c Tue Aug 10 14:54:15 1993
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: answer.c,v 5.5 1993/02/04 15:32:52 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.5 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: answer.c,v 5.7 1993/08/10 18:54:13 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.7 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,35 ----
*
*******************************************************************************
* $Log: answer.c,v $
+ * Revision 5.7 1993/08/10 18:54:13 syd
+ * A change to answer:s mail command to be like those of elm and filter.
+ * From:
[email protected] (Jan Djarv)
+ *
+ * Revision 5.6 1993/08/03 19:28:39 syd
+ * Elm tries to replace the system toupper() and tolower() on current
+ * BSD systems, which is unnecessary. Even worse, the replacements
+ * collide during linking with routines in isctype.o. This patch adds
+ * a Configure test to determine whether replacements are really needed
+ * (BROKE_CTYPE definition). The <ctype.h> header file is now included
+ * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
+ * there. Inclusion of <ctype.h> was removed from *all* the individual
+ * files, and the toupper() and tolower() routines in lib/opt_utils.c
+ * were dropped.
+ * From:
[email protected] (Chip Rosenthal)
+ *
* Revision 5.5 1993/02/04 15:32:52 syd
* Add cast to silence compiler warning.
* From:
[email protected] (Chip Rosenthal)
***************
*** 50,60 ****
#include "ndbz.h"
#include "s_answer.h"
#include "sysdefs.h"
- #include <ctype.h>
-
- #ifdef BSD
- #undef tolower
- #endif
#define ELM "elm" /* where the elm program lives */
--- 66,71 ----
***************
*** 250,257 ****
fclose(fd);
sprintf(buffer, catgets(elm_msg_cat, AnswerSet, AnswerElmCommand,
! "( ( %s -s \"While You Were Out\" %s ; %s %s) & ) < %s > /dev/null"),
! ELM, strip_parens(address), remove_cmd, tempfile, tempfile);
system(buffer);
}
--- 261,268 ----
fclose(fd);
sprintf(buffer, catgets(elm_msg_cat, AnswerSet, AnswerElmCommand,
! "( ( %s -s \"While You Were Out\" %s < %s ; %s %s) & ) > /dev/null"),
! ELM, strip_parens(address), tempfile, remove_cmd, tempfile);
system(buffer);
}
***************
*** 270,277 ****
for (i=0, len = strlen(fullname); i < len; i++) {
! if (isupper(fullname[i]))
! fullname[i] = tolower(fullname[i]);
if (fullname[i] == ' ')
if (lastname) {
--- 281,287 ----
for (i=0, len = strlen(fullname); i < len; i++) {
! fullname[i] = tolower(fullname[i]);
if (fullname[i] == ' ')
if (lastname) {
Index: utils/arepdaem.c
Prereq: 5.12
*** ../elm2.4/utils/arepdaem.c Mon May 31 15:39:25 1993
--- utils/arepdaem.c Tue Aug 3 15:29:26 1993
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: arepdaem.c,v 5.12 1993/05/31 19:39:24 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.12 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: arepdaem.c,v 5.13 1993/08/03 19:28:39 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.13 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,31 ----
*
*******************************************************************************
* $Log: arepdaem.c,v $
+ * Revision 5.13 1993/08/03 19:28:39 syd
+ * Elm tries to replace the system toupper() and tolower() on current
+ * BSD systems, which is unnecessary. Even worse, the replacements
+ * collide during linking with routines in isctype.o. This patch adds
+ * a Configure test to determine whether replacements are really needed
+ * (BROKE_CTYPE definition). The <ctype.h> header file is now included
+ * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
+ * there. Inclusion of <ctype.h> was removed from *all* the individual
+ * files, and the toupper() and tolower() routines in lib/opt_utils.c
+ * were dropped.
+ * From:
[email protected] (Chip Rosenthal)
+ *
* Revision 5.12 1993/05/31 19:39:24 syd
* check for missing replyfile
* From:
[email protected] (Roy Mongiovi)
***************
*** 107,113 ****
#endif
#include <sys/stat.h>
- #include <ctype.h>
#include <errno.h>
#define arep_lock_file "LCK..arep"
--- 119,124 ----
Index: utils/elmalias.c
Prereq: 5.2
*** ../elm2.4/utils/elmalias.c Sun May 16 16:55:32 1993
--- utils/elmalias.c Sun Sep 26 21:05:37 1993
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: elmalias.c,v 5.2 1993/05/16 20:55:32 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.2 $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: elmalias.c,v 5.8 1993/09/27 01:05:37 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.8 $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,43 ----
*
*******************************************************************************
* $Log: elmalias.c,v $
+ * Revision 5.8 1993/09/27 01:05:37 syd
+ * Eliminate warning about redeclaring getpwuid().
+ * From: riacs!rutgers!tscs.tscs.com!fin!chip (Chip Salzenberg)
+ *
+ * Revision 5.7 1993/09/19 23:12:00 syd
+ * Add ability for elmalias to determine HOME if missing from the environment.
+ * From:
[email protected] (Chip Rosenthal)
+ *
+ * Revision 5.6 1993/08/23 02:44:41 syd
+ * fix where checkalias doesn't fully expand multi-database aliases
+ * From: Steve Wolf <
[email protected]>
+ *
+ * Revision 5.5 1993/08/03 19:23:25 syd
+ * Added -d option to elmalias.
+ * From:
[email protected] (Jan Djarv)
+ *
+ * Revision 5.4 1993/07/27 20:27:33 syd
+ * fix strchr, Elm uses define to make index strchr when needed
+ * From: Syd
+ *
+ * Revision 5.3 1993/07/20 02:59:53 syd
+ * Support aliases both on 64 bit and 32 bit machines at the same time.
+ * From: Dan Mosedale <
[email protected]>
+ *
* Revision 5.2 1993/05/16 20:55:32 syd
* fix elmalias bug
* From:
[email protected] (Chip Rosenthal)
***************
*** 60,69 ****
* alias chip is address "
[email protected]" (Chip Rosenthal)
*
* Synopsis:
! * elmalias [-aensuvV] [-f format] [alias ...]
*
* Options:
* -a Display alias name. Equivalent to -f "%-20.20a %v".
* -e Fully expand alias values.
* -f fmt User-specified output format.
* -n Display name. Equivalent to -f "%v?n (%n)?".
--- 84,94 ----
* alias chip is address "
[email protected]" (Chip Rosenthal)
*
* Synopsis:
! * elmalias [-adensuvV] [-f format] [alias ...]
*
* Options:
* -a Display alias name. Equivalent to -f "%-20.20a %v".
+ * -d Turn debugging on. Only useful if DEBUG is defined.
* -e Fully expand alias values.
* -f fmt User-specified output format.
* -n Display name. Equivalent to -f "%v?n (%n)?".
***************
*** 80,86 ****
--- 105,117 ----
#include "elmutil.h"
#include "ndbz.h"
#include "s_elmalias.h"
+ #include <pwd.h>
+ char *getenv();
+ #ifndef _POSIX_SOURCE
+ struct passwd *getpwuid();
+ #endif
+
/*
* Maximum number of alias files we can consult.
*/
***************
*** 114,120 ****
void usage_error()
{
fprintf(stderr, catgets(elm_msg_cat, ElmaliasSet, ElmaliasUsage,
! "usage: %s [-aenrsuvV] [-f format] [alias ...]\n"), Progname);
exit(1);
/*NOTREACHED*/
}
--- 145,151 ----
void usage_error()
{
fprintf(stderr, catgets(elm_msg_cat, ElmaliasSet, ElmaliasUsage,
! "usage: %s [-adenrsuvV] [-f format] [alias ...]\n"), Progname);
exit(1);
/*NOTREACHED*/
}
***************
*** 168,178 ****
/*
* Crack command line options.
*/
! while ((i = getopt(argc, argv, "aef:nrsuvV")) != EOF) {
switch (i) {
case 'a': /* show alias name and value */
out_fmt = "%-20.20a %v";
break;
case 'e': /* recursively expand aliases */
do_expand = TRUE;
break;
--- 199,214 ----
/*
* Crack command line options.
*/
! while ((i = getopt(argc, argv, "adef:nrsuvV")) != EOF) {
switch (i) {
case 'a': /* show alias name and value */
out_fmt = "%-20.20a %v";
break;
+ case 'd':
+ #ifdef DEBUG
+ debug = 10;
+ #endif
+ break;
case 'e': /* recursively expand aliases */
do_expand = TRUE;
break;
***************
*** 273,279 ****
ar = make_dummy_rec(argv[i]);
print_alias(out_fmt, ar);
} else if (do_expand && (ar->type & GROUP)) {
! exp_print_alias(dblist[d], out_fmt, ar);
} else {
print_alias(out_fmt, ar);
}
--- 309,315 ----
ar = make_dummy_rec(argv[i]);
print_alias(out_fmt, ar);
} else if (do_expand && (ar->type & GROUP)) {
! exp_print_alias(dblist, out_fmt, ar);
} else {
print_alias(out_fmt, ar);
}
***************
*** 297,309 ****
{
char *home, *fname;
DBZ *db;
! extern char *getenv();
! if ((home = getenv("HOME")) == NULL) {
! fprintf(stderr, catgets(elm_msg_cat, ElmaliasSet,
! ElmaliasCannotDetermineHome,
! "%s: cannot determine your HOME directory\n"), Progname);
! exit(1);
}
fname = (char *)safe_malloc(strlen(home) + 1 + strlen(ALIAS_DATA) + 1);
(void) strcat(strcat(strcpy(fname, home), "/"), ALIAS_DATA);
--- 333,349 ----
{
char *home, *fname;
DBZ *db;
! struct passwd *pw;
! if ((home = getenv("HOME")) == NULL || *home == '\0') {
! if ((pw = getpwuid(getuid())) == NULL) {
! fprintf(stderr, catgets(elm_msg_cat, ElmaliasSet,
! ElmaliasCannotDetermineHome,
! "%s: cannot determine your HOME directory\n"), Progname);
! exit(1);
! }
! home = pw->pw_dir;
! endpwent();
}
fname = (char *)safe_malloc(strlen(home) + 1 + strlen(ALIAS_DATA) + 1);
(void) strcat(strcat(strcpy(fname, home), "/"), ALIAS_DATA);
***************
*** 336,343 ****
/*
* Recursively expand out a list of addresses and print the expansions.
*/
! void exp_print_alias(db, fmt, ar)
! DBZ *db;
char *fmt;
struct alias_rec *ar;
{
--- 376,383 ----
/*
* Recursively expand out a list of addresses and print the expansions.
*/
! void exp_print_alias(dblist, fmt, ar)
! DBZ *dblist[];
char *fmt;
struct alias_rec *ar;
{
***************
*** 345,350 ****
--- 385,391 ----
char *acurr; /* pointer to current address within "abuf" */
char *anext; /* pointer to next address within "abuf" */
struct alias_rec *ar0;
+ int d; /* dblist index */
/*
* Create a copy of this address we can scribble upon.
***************
*** 358,367 ****
* Go through all of the addresses and expand them out.
*/
while ((acurr = next_addr_in_list(&anext)) != NULL) {
! if ((ar0 = fetch_alias(db, acurr)) == NULL)
ar0 = make_dummy_rec(acurr);
if (ar0->type & GROUP)
! exp_print_alias(db, fmt, ar0);
else
print_alias(fmt, ar0);
(void) free((malloc_t)ar0);
--- 399,412 ----
* Go through all of the addresses and expand them out.
*/
while ((acurr = next_addr_in_list(&anext)) != NULL) {
! for (d = 0 ; dblist[d] != NULL ; ++d) {
! if ((ar0 = fetch_alias(dblist[d], acurr)) != NULL)
! break;
! }
! if (ar0 == NULL)
ar0 = make_dummy_rec(acurr);
if (ar0->type & GROUP)
! exp_print_alias(dblist, fmt, ar0);
else
print_alias(fmt, ar0);
(void) free((malloc_t)ar0);
***************
*** 401,407 ****
*/
pfmt[0] = *fmt++;
n = 1;
! while (strchr("-.0123456789", *fmt) != NULL) {
if (n < sizeof(pfmt)-2)
pfmt[n++] = *fmt;
++fmt;
--- 446,452 ----
*/
pfmt[0] = *fmt++;
n = 1;
! while (index("-.0123456789", *fmt) != NULL) {
if (n < sizeof(pfmt)-2)
pfmt[n++] = *fmt;
++fmt;
Index: utils/fastmail.c
Prereq: 5.7
*** ../elm2.4/utils/fastmail.c Sun Jun 6 14:32:10 1993
--- utils/fastmail.c Mon Jul 19 22:46:37 1993
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: fastmail.c,v 5.7 1993/06/06 18:31:43 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.7 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: fastmail.c,v 5.8 1993/07/20 02:46:36 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.8 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,24 ----
*
*******************************************************************************
* $Log: fastmail.c,v $
+ * Revision 5.8 1993/07/20 02:46:36 syd
+ * In fastmail, if environment variable $REPLYTO is set, use it as
+ * default Reply-To. Also, eliminate unnecessary strlen() calls.
+ * From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg)
+ *
* Revision 5.7 1993/06/06 18:31:43 syd
* fix typo
*
***************
*** 99,105 ****
char replyto[SLEN], cc_list[SLEN], bcc_list[SLEN], to_list[SLEN];
char from_addr[SLEN], comments[SLEN], inreplyto[NLEN];
char references[SLEN];
! char *tmplogname;
int c, sendmail_available, debug = 0;
elm_msg_cat = catopen("elm2.4", 0);
--- 104,110 ----
char replyto[SLEN], cc_list[SLEN], bcc_list[SLEN], to_list[SLEN];
char from_addr[SLEN], comments[SLEN], inreplyto[NLEN];
char references[SLEN];
! char *p;
int c, sendmail_available, debug = 0;
elm_msg_cat = catopen("elm2.4", 0);
***************
*** 115,120 ****
--- 120,128 ----
inreplyto[0] = '\0';
references[0] = '\0';
+ if ((p = getenv("REPLYTO")) != NULL)
+ strcpy(replyto, p);
+
while ((c = getopt(argc, argv, "b:c:C:df:F:i:r:R:s:")) != EOF) {
switch (c) {
case 'b' : strcpy(bcc_list, optarg); break;
***************
*** 147,159 ****
gethostname(hostname, sizeof(hostname));
#endif
! tmplogname = getlogin();
! if (tmplogname != NULL)
! strcpy(username, tmplogname);
! else
! username[0] = '\0';
!
! if (strlen(username) == 0)
cuserid(username);
if (strcmp(filename, "-")) {
--- 155,164 ----
gethostname(hostname, sizeof(hostname));
#endif
! username[0] = '\0';
! if ((p = getlogin()) != NULL)
! strcpy(username, p);
! if (!username[0])
cuserid(username);
if (strcmp(filename, "-")) {
***************
*** 213,237 ****
fprintf(tempfile, "Date: %s\n", get_arpa_date());
! if (strlen(replyto) > 0)
fprintf(tempfile, "Reply-To: %s\n", replyto);
! while (optind < argc)
! sprintf(to_list, "%s%s%s", to_list, (strlen(to_list) > 0? ",":""),
! argv[optind++]);
fprintf(tempfile, "To: %s\n", to_list);
! if (strlen(cc_list) > 0)
fprintf(tempfile, "Cc: %s\n", cc_list);
! if (strlen(references) > 0)
fprintf(tempfile, "References: %s\n", references);
! if (strlen(inreplyto) > 0)
fprintf(tempfile, "In-Reply-To: %s\n", inreplyto);
! if (strlen(comments) > 0)
fprintf(tempfile, "Comments: %s\n", comments);
#ifndef NO_XHEADER
--- 218,244 ----
fprintf(tempfile, "Date: %s\n", get_arpa_date());
! if (replyto[0])
fprintf(tempfile, "Reply-To: %s\n", replyto);
! while (optind < argc) {
! if (to_list[0])
! strcat(to_list, ",");
! strcat(to_list, argv[optind++]);
! }
fprintf(tempfile, "To: %s\n", to_list);
! if (cc_list[0])
fprintf(tempfile, "Cc: %s\n", cc_list);
! if (references[0])
fprintf(tempfile, "References: %s\n", references);
! if (inreplyto[0])
fprintf(tempfile, "In-Reply-To: %s\n", inreplyto);
! if (comments[0])
fprintf(tempfile, "Comments: %s\n", comments);
#ifndef NO_XHEADER
***************
*** 248,255 ****
if (debug)
printf("Mailing to %s%s%s%s%s [via %s]\n", to_list,
! (strlen(cc_list) > 0 ? " ":""), cc_list,
! (strlen(bcc_list) > 0 ? " ":""), bcc_list,
sendmail_available? "sendmail" : "rmail");
sprintf(command_buffer, "cat %s %s | %s %s %s %s",
--- 255,262 ----
if (debug)
printf("Mailing to %s%s%s%s%s [via %s]\n", to_list,
! (cc_list[0] ? " ":""), cc_list,
! (bcc_list[0] ? " ":""), bcc_list,
sendmail_available? "sendmail" : "rmail");
sprintf(command_buffer, "cat %s %s | %s %s %s %s",
Index: utils/newmail.c
Prereq: 5.18
*** ../elm2.4/utils/newmail.c Sun Jun 6 14:24:48 1993
--- utils/newmail.c Tue Aug 3 15:29:27 1993
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: newmail.c,v 5.18 1993/06/06 18:00:10 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.18 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: newmail.c,v 5.19 1993/08/03 19:28:39 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.19 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,31 ----
*
*******************************************************************************
* $Log: newmail.c,v $
+ * Revision 5.19 1993/08/03 19:28:39 syd
+ * Elm tries to replace the system toupper() and tolower() on current
+ * BSD systems, which is unnecessary. Even worse, the replacements
+ * collide during linking with routines in isctype.o. This patch adds
+ * a Configure test to determine whether replacements are really needed
+ * (BROKE_CTYPE definition). The <ctype.h> header file is now included
+ * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
+ * there. Inclusion of <ctype.h> was removed from *all* the individual
+ * files, and the toupper() and tolower() routines in lib/opt_utils.c
+ * were dropped.
+ * From:
[email protected] (Chip Rosenthal)
+ *
* Revision 5.18 1993/06/06 18:00:10 syd
* Fix max folder check, off by one
*
***************
*** 143,149 ****
**/
#include "elmutil.h"
- #include <ctype.h>
#include "s_newmail.h"
#ifdef PWDINSYS
--- 155,160 ----
Index: utils/prlong.c
Prereq: 5.2
*** ../elm2.4/utils/prlong.c Tue Apr 20 21:41:19 1993
--- utils/prlong.c Tue Aug 3 15:29:28 1993
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: prlong.c,v 5.2 1993/04/21 01:41:14 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.2 $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: prlong.c,v 5.3 1993/08/03 19:28:39 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.3 $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,31 ----
*
*******************************************************************************
* $Log: prlong.c,v $
+ * Revision 5.3 1993/08/03 19:28:39 syd
+ * Elm tries to replace the system toupper() and tolower() on current
+ * BSD systems, which is unnecessary. Even worse, the replacements
+ * collide during linking with routines in isctype.o. This patch adds
+ * a Configure test to determine whether replacements are really needed
+ * (BROKE_CTYPE definition). The <ctype.h> header file is now included
+ * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
+ * there. Inclusion of <ctype.h> was removed from *all* the individual
+ * files, and the toupper() and tolower() routines in lib/opt_utils.c
+ * were dropped.
+ * From:
[email protected] (Chip Rosenthal)
+ *
* Revision 5.2 1993/04/21 01:41:14 syd
* Needs ctype.h
* From: Syd
***************
*** 61,67 ****
#include <stdio.h>
- #include <ctype.h>
#include "defs.h"
#define MAXWID 78 /* default maximum line width */
--- 73,78 ----
Index: utils/readmsg.c
Prereq: 5.9
*** ../elm2.4/utils/readmsg.c Tue Apr 20 21:17:52 1993
--- utils/readmsg.c Tue Aug 3 15:29:29 1993
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: readmsg.c,v 5.9 1993/04/21 01:17:51 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.9 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: readmsg.c,v 5.10 1993/08/03 19:28:39 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.10 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,31 ----
*
*******************************************************************************
* $Log: readmsg.c,v $
+ * Revision 5.10 1993/08/03 19:28:39 syd
+ * Elm tries to replace the system toupper() and tolower() on current
+ * BSD systems, which is unnecessary. Even worse, the replacements
+ * collide during linking with routines in isctype.o. This patch adds
+ * a Configure test to determine whether replacements are really needed
+ * (BROKE_CTYPE definition). The <ctype.h> header file is now included
+ * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
+ * there. Inclusion of <ctype.h> was removed from *all* the individual
+ * files, and the toupper() and tolower() routines in lib/opt_utils.c
+ * were dropped.
+ * From:
[email protected] (Chip Rosenthal)
+ *
* Revision 5.9 1993/04/21 01:17:51 syd
* readmsg treated a line with From_ preceeded by whitespace as a valid
* message delimiter.
***************
*** 115,121 ****
#include "elmutil.h"
#include "s_readmsg.h"
- #include <ctype.h>
/** three defines for what level of headers to display **/
#define ALL 1
--- 127,132 ----
Index: filter/utils.c
Prereq: 5.3
*** ../elm2.4/filter/utils.c Wed Jan 27 14:40:07 1993
--- filter/utils.c Tue Aug 3 15:28:42 1993
***************
*** 1,8 ****
! static char rcsid[] ="@(#)$Id: utils.c,v 5.3 1993/01/27 19:40:01 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.3 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
! static char rcsid[] ="@(#)$Id: utils.c,v 5.4 1993/08/03 19:28:39 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.4 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,31 ----
*
*******************************************************************************
* $Log: utils.c,v $
+ * Revision 5.4 1993/08/03 19:28:39 syd
+ * Elm tries to replace the system toupper() and tolower() on current
+ * BSD systems, which is unnecessary. Even worse, the replacements
+ * collide during linking with routines in isctype.o. This patch adds
+ * a Configure test to determine whether replacements are really needed
+ * (BROKE_CTYPE definition). The <ctype.h> header file is now included
+ * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
+ * there. Inclusion of <ctype.h> was removed from *all* the individual
+ * files, and the toupper() and tolower() routines in lib/opt_utils.c
+ * were dropped.
+ * From:
[email protected] (Chip Rosenthal)
+ *
* Revision 5.3 1993/01/27 19:40:01 syd
* I implemented a change to filter's default verbose message format
* including %x %X style date and time along with username
***************
*** 36,42 ****
#include <stdio.h>
#include <pwd.h>
- #include <ctype.h>
#include <fcntl.h>
#include "defs.h"
--- 48,53 ----
***************
*** 187,194 ****
register int i = 0, j = 0;
while (str[i] != '\0') {
! while ((isupper(str[i]) ? tolower(str[i]) : str[i]) ==
! (isupper(pat[j]) ? tolower(pat[j]) : pat[j])) {
i++; j++;
if (pat[j] == '\0')
return(TRUE);
--- 198,204 ----
register int i = 0, j = 0;
while (str[i] != '\0') {
! while (tolower(str[i]) == tolower(pat[j])) {
i++; j++;
if (pat[j] == '\0')
return(TRUE);
Index: filter/regexp.c
Prereq: 5.6
*** ../elm2.4/filter/regexp.c Thu Dec 10 20:45:26 1992
--- filter/regexp.c Wed Jun 9 23:12:16 1993
***************
*** 1,8 ****
! /* $Id: regexp.c,v 5.6 1992/12/11 01:45:04 syd Exp $ */
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.6 $ $State: Exp $
*
* Copyright (c) 1992 USENET Community Trust
*******************************************************************************
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: regexp.c,v 5.7 1993/06/10 03:12:10 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.7 $ $State: Exp $
*
* Copyright (c) 1992 USENET Community Trust
*******************************************************************************
***************
*** 13,18 ****
--- 13,22 ----
*
*******************************************************************************
* $Log: regexp.c,v $
+ * Revision 5.7 1993/06/10 03:12:10 syd
+ * Add missing rcs id lines
+ * From: Syd
+ *
* Revision 5.6 1992/12/11 01:45:04 syd
* remove sys/types.h include, it is now included by defs.h
* and this routine includes defs.h or indirectly includes defs.h
Index: filter/rules.c
Prereq: 5.7
*** ../elm2.4/filter/rules.c Wed Jan 27 14:45:16 1993
--- filter/rules.c Tue Aug 3 15:28:42 1993
***************
*** 1,8 ****
! static char rcsid[] ="@(#)$Id: rules.c,v 5.7 1993/01/27 19:45:15 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.7 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
! static char rcsid[] ="@(#)$Id: rules.c,v 5.8 1993/08/03 19:28:39 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.8 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,31 ----
*
*******************************************************************************
* $Log: rules.c,v $
+ * Revision 5.8 1993/08/03 19:28:39 syd
+ * Elm tries to replace the system toupper() and tolower() on current
+ * BSD systems, which is unnecessary. Even worse, the replacements
+ * collide during linking with routines in isctype.o. This patch adds
+ * a Configure test to determine whether replacements are really needed
+ * (BROKE_CTYPE definition). The <ctype.h> header file is now included
+ * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
+ * there. Inclusion of <ctype.h> was removed from *all* the individual
+ * files, and the toupper() and tolower() routines in lib/opt_utils.c
+ * were dropped.
+ * From:
[email protected] (Chip Rosenthal)
+ *
* Revision 5.7 1993/01/27 19:45:15 syd
* Filter turns spaces in quoted strings into _ and then back again. This destroys
* any _ that where there in the first place. This patch removes that.
***************
*** 65,71 ****
#include <stdio.h>
#include "defs.h"
#include <pwd.h>
- #include <ctype.h>
#ifdef I_TIME
# include <time.h>
#endif
--- 77,82 ----
Index: lib/mk_aliases.c
Prereq: 5.12
*** ../elm2.4/lib/mk_aliases.c Sat May 8 16:25:34 1993
--- lib/mk_aliases.c Tue Aug 3 15:28:53 1993
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: mk_aliases.c,v 5.12 1993/05/08 20:25:33 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.12 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: mk_aliases.c,v 5.15 1993/08/03 19:28:39 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.15 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,40 ----
*
*******************************************************************************
* $Log: mk_aliases.c,v $
+ * Revision 5.15 1993/08/03 19:28:39 syd
+ * Elm tries to replace the system toupper() and tolower() on current
+ * BSD systems, which is unnecessary. Even worse, the replacements
+ * collide during linking with routines in isctype.o. This patch adds
+ * a Configure test to determine whether replacements are really needed
+ * (BROKE_CTYPE definition). The <ctype.h> header file is now included
+ * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
+ * there. Inclusion of <ctype.h> was removed from *all* the individual
+ * files, and the toupper() and tolower() routines in lib/opt_utils.c
+ * were dropped.
+ * From:
[email protected] (Chip Rosenthal)
+ *
+ * Revision 5.14 1993/07/20 02:59:53 syd
+ * Support aliases both on 64 bit and 32 bit machines at the same time.
+ * From: Dan Mosedale <
[email protected]>
+ *
+ * Revision 5.13 1993/07/20 01:45:56 syd
+ * When resyncing aliases from elm, and there was aliases to delete,
+ * the alias.pag file could be corrupted since file_offset wasn't set to zero.
+ * From:
[email protected] (Jan Djarv)
+ *
* Revision 5.12 1993/05/08 20:25:33 syd
* Add sleepmsg to control transient message delays
* From: Syd
***************
*** 110,122 ****
#include "headers.h"
#include "s_newalias.h"
- #include <ctype.h>
#include "ndbz.h"
#ifdef BSD
# include <sys/file.h>
- # undef tolower
- # undef toupper
#endif
#define group(string) (index(string,',') != NULL)
--- 131,140 ----
***************
*** 278,287 ****
int
add_to_hash_table(word, offset)
char *word;
! long offset;
{
datum key, value, ovalue;
! long off;
key.dptr = word;
key.dsize = strlen(word);
--- 296,305 ----
int
add_to_hash_table(word, offset)
char *word;
! int32 offset;
{
datum key, value, ovalue;
! int32 off;
key.dptr = word;
key.dsize = strlen(word);
***************
*** 320,326 ****
FILE *data;
register char *aliases, *lastn, *firstn, *comment, *addresses;
{
! struct alias_rec alias;
register char *s;
/*
* crack the information into an alias_rec structure, then add the entry
--- 338,344 ----
FILE *data;
register char *aliases, *lastn, *firstn, *comment, *addresses;
{
! struct alias_disk_rec alias;
register char *s;
/*
* crack the information into an alias_rec structure, then add the entry
***************
*** 357,363 ****
* Only add an entry if we could add it to the hash table.
* (no errors or duplicates)
*/
! if (add_to_hash_table(aliases, file_offset+sizeof(alias)) == 0) {
file_offset += alias.length + sizeof(alias);
/*
* Write the entry to the data file, followed by its data
--- 375,382 ----
* Only add an entry if we could add it to the hash table.
* (no errors or duplicates)
*/
! if (add_to_hash_table(aliases, (int32)(file_offset+sizeof(alias)))
! == 0) {
file_offset += alias.length + sizeof(alias);
/*
* Write the entry to the data file, followed by its data
***************
*** 714,719 ****
--- 733,739 ----
buff_loaded = 0; /* file buffer empty right now! */
al_count = 0;
err_flag = 0;
+ file_offset = 0;
while (get_alias(in, fromelm) != -1) {
put_alias(data);
Index: lib/msgcat.c
*** ../elm2.4/lib/msgcat.c Sun Apr 11 23:22:31 1993
--- lib/msgcat.c Wed Jun 9 23:12:20 1993
***************
*** 1,3 ****
--- 1,6 ----
+
+ static char rcsid[] = "@(#)$Id: msgcat.c,v 5.2 1993/06/10 03:12:10 syd Exp $";
+
/* -*- c++ -*- */
/***********************************************************
Index: src/curses.c
Prereq: 5.10
*** ../elm2.4/src/curses.c Sun Apr 11 23:57:46 1993
--- src/curses.c Sun Aug 22 22:56:36 1993
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: curses.c,v 5.10 1993/04/12 03:57:45 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.10 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: curses.c,v 5.13 1993/08/23 02:56:35 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.13 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,42 ----
*
*******************************************************************************
* $Log: curses.c,v $
+ * Revision 5.13 1993/08/23 02:56:35 syd
+ * have Writechar() backspace over the left edge of the screen to the end
+ * of the previous line if the current line is not the first line on the
+ * screen.
+ * From: Jukka Ukkonen <
[email protected]>
+ *
+ * Revision 5.12 1993/08/03 19:28:39 syd
+ * Elm tries to replace the system toupper() and tolower() on current
+ * BSD systems, which is unnecessary. Even worse, the replacements
+ * collide during linking with routines in isctype.o. This patch adds
+ * a Configure test to determine whether replacements are really needed
+ * (BROKE_CTYPE definition). The <ctype.h> header file is now included
+ * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
+ * there. Inclusion of <ctype.h> was removed from *all* the individual
+ * files, and the toupper() and tolower() routines in lib/opt_utils.c
+ * were dropped.
+ * From:
[email protected] (Chip Rosenthal)
+ *
+ * Revision 5.11 1993/07/20 02:13:20 syd
+ * Make tabspacing check for <= 0 so we dont get divide by
+ * zero errors when the termcap has tabspacing 0
+ * From: Syd via request from G A Smant
+ *
* Revision 5.10 1993/04/12 03:57:45 syd
* Give up and add an Ultrix specific patch. There is a bug in Ispell under
* ultrix. The problem is that when ispell returns, the terminal is no
***************
*** 90,106 ****
# endif
#endif
- #include <ctype.h>
-
#ifdef PTEM
# include <sys/stream.h>
# include <sys/ptem.h>
#endif
- #ifdef BSD
- #undef tolower
- #endif
-
#define TTYIN 0
#ifdef SHORTNAMES
--- 113,123 ----
***************
*** 202,208 ****
_cleartoeos = tgetstr("cd", &ptr);
_lines = tgetnum("li");
_columns = tgetnum("co");
! tabspacing = ((tabspacing=tgetnum("it"))==-1 ? 8 : tabspacing);
_automargin = tgetflag("am");
_eatnewlineglitch = tgetflag("xn");
_transmit_on = tgetstr("ks", &ptr);
--- 219,225 ----
_cleartoeos = tgetstr("cd", &ptr);
_lines = tgetnum("li");
_columns = tgetnum("co");
! tabspacing = ((tabspacing=tgetnum("it"))<= 0 ? 8 : tabspacing);
_automargin = tgetflag("am");
_eatnewlineglitch = tgetflag("xn");
_transmit_on = tgetstr("ks", &ptr);
***************
*** 706,715 ****
/* if backspace, move back one space if not already in column 0 */
else if (ch == BACKSPACE) {
! if(_col != 0) {
! tputs(_left, 1, outchar);
! _col--;
! } /* else BACKSPACE does nothing */
}
/* if bell, ring the bell but don't advance the column */
--- 723,738 ----
/* if backspace, move back one space if not already in column 0 */
else if (ch == BACKSPACE) {
! if (_col != 0) {
! tputs(_left, 1, outchar);
! _col--;
! }
! else if (_line > 0) {
! _col = COLUMNS - 1;
! _line--;
! moveabsolute (_col, _line);
! }
! /* else BACKSPACE does nothing */
}
/* if bell, ring the bell but don't advance the column */
Index: src/date.c
Prereq: 5.4
*** ../elm2.4/src/date.c Thu Dec 10 20:45:32 1992
--- src/date.c Tue Aug 3 15:29:03 1993
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: date.c,v 5.4 1992/12/11 01:45:04 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.4 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: date.c,v 5.5 1993/08/03 19:28:39 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.5 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,31 ----
*
*******************************************************************************
* $Log: date.c,v $
+ * Revision 5.5 1993/08/03 19:28:39 syd
+ * Elm tries to replace the system toupper() and tolower() on current
+ * BSD systems, which is unnecessary. Even worse, the replacements
+ * collide during linking with routines in isctype.o. This patch adds
+ * a Configure test to determine whether replacements are really needed
+ * (BROKE_CTYPE definition). The <ctype.h> header file is now included
+ * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
+ * there. Inclusion of <ctype.h> was removed from *all* the individual
+ * files, and the toupper() and tolower() routines in lib/opt_utils.c
+ * were dropped.
+ * From:
[email protected] (Chip Rosenthal)
+ *
* Revision 5.4 1992/12/11 01:45:04 syd
* remove sys/types.h include, it is now included by defs.h
* and this routine includes defs.h or indirectly includes defs.h
***************
*** 49,65 ****
# include <sys/timeb.h>
#endif
- #include <ctype.h>
-
#ifndef _POSIX_SOURCE
extern struct tm *localtime();
extern struct tm *gmtime();
extern time_t time();
#endif
-
- #ifdef BSD
- #undef tolower
- #endif
#define MONTHS_IN_YEAR 11 /* 0-11 equals 12 months! */
#define FEB 1 /* 0 = January */
--- 61,71 ----
Index: src/editmsg.c
Prereq: 5.12
*** ../elm2.4/src/editmsg.c Sat May 8 16:25:38 1993
--- src/editmsg.c Sun Sep 26 21:51:57 1993
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: editmsg.c,v 5.12 1993/05/08 20:25:33 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.12 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: editmsg.c,v 5.19 1993/09/27 01:51:38 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.19 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,86 ----
*
*******************************************************************************
* $Log: editmsg.c,v $
+ * Revision 5.19 1993/09/27 01:51:38 syd
+ * Add elm_chown to consolidate for Xenix not allowing -1
+ * From: Syd
+ *
+ * Revision 5.18 1993/08/23 03:26:24 syd
+ * Try setting group id separate from user id in chown to
+ * allow restricted systems to change group id of file
+ * From: Syd
+ *
+ * Revision 5.17 1993/08/23 02:55:38 syd
+ * Fix problem where deleting to previous line caused duplication due to the
+ * file being opened for append (in append mode, all writes are to the end of
+ * file regardless of the file pointer).
+ * From:
[email protected] (Paul Close)
+ *
+ * Revision 5.16 1993/08/03 20:12:46 syd
+ * Fix signal type for 386bsd
+ * From: Scott Mace <
[email protected]>
+ *
+ * Revision 5.15 1993/08/03 19:28:39 syd
+ * Elm tries to replace the system toupper() and tolower() on current
+ * BSD systems, which is unnecessary. Even worse, the replacements
+ * collide during linking with routines in isctype.o. This patch adds
+ * a Configure test to determine whether replacements are really needed
+ * (BROKE_CTYPE definition). The <ctype.h> header file is now included
+ * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
+ * there. Inclusion of <ctype.h> was removed from *all* the individual
+ * files, and the toupper() and tolower() routines in lib/opt_utils.c
+ * were dropped.
+ * From:
[email protected] (Chip Rosenthal)
+ *
+ * Revision 5.14 1993/07/20 02:41:24 syd
+ * Three changes to expand_env() in src/read_rc.c: make it non-destructive,
+ * have it return an error code instead of bailing out, and add a buffer
+ * size argument to avoid overwritting the destination. The first is to
+ * avoid all of the gymnastics Elm needed to go through (and occasionally
+ * forgot to go through) to protect the value handed to expand_env().
+ * The second is because expand_env() was originally written to support
+ * "elmrc" and bailing out was a reasonable thing to do there -- but not
+ * in the other places where it has since been used. The third is just
+ * a matter of practicing safe source code.
+ *
+ * This patch changes all invocations to expand_env() to eliminate making
+ * temporary copies (now that the routine is non-destructive) and to pass
+ * in a destination length. Since expand_env() no longer bails out on
+ * error, a do_expand_env() routine was added to src/read_rc.c handle
+ * this. Moreover, the error message now gives some indication of what
+ * the problem is rather than just saying "can't expand".
+ *
+ * Gratitous change to src/editmsg.c renaming filename variables to
+ * clarify the purpose.
+ * From:
[email protected] (Chip Rosenthal)
+ *
+ * Revision 5.13 1993/06/10 03:07:39 syd
+ * This fixes a bug in the MIME code. Include_Part() uses expand_env()
+ * to expand the include file name, but since expand_env() is destructive
+ * [it uses strtok()] the file name gets corrupted, and the "Content-Name"
+ * header can contain a bogus value. The easy fix would be a one-line
+ * hack to Include_Part to use a temporary buffer. This patch does not
+ * implement the easy fix. *Every* place expand_env() is used, its side
+ * effects cause problems. I think the right fix is to make expand_env()
+ * non-destructive (i.e. have it duplicate the input to a temporary buffer
+ * and work from there). The attached patch modifies expand_env() in
+ * that manner, and eliminates all of the `copy to a temporary buffer'
+ * calls that precede it throughout elm.
+ * From:
[email protected] (Chip Rosenthal)
+ *
* Revision 5.12 1993/05/08 20:25:33 syd
* Add sleepmsg to control transient message delays
* From: Syd
***************
*** 81,89 ****
/* BSD has already included setjmp.h in headers.h */
#include <setjmp.h>
#endif /* BSD */
- #include <ctype.h>
! #ifdef POSIX_SIGNALS
# define JMP_BUF sigjmp_buf
# define SETJMP(env) sigsetjmp((env), 1)
# define LONGJMP(env,val) siglongjmp((env), (val))
--- 148,155 ----
/* BSD has already included setjmp.h in headers.h */
#include <setjmp.h>
#endif /* BSD */
! #if defined(POSIX_SIGNALS) && !defined(__386BSD__)
# define JMP_BUF sigjmp_buf
# define SETJMP(env) sigsetjmp((env), 1)
# define LONGJMP(env,val) siglongjmp((env), (val))
***************
*** 93,102 ****
# define LONGJMP(env,val) longjmp((env), (val))
#endif
- #ifdef BSD
- #undef tolower
- #endif
-
char *error_description(), *format_long(), *strip_commas();
long fsize();
--- 159,164 ----
***************
*** 202,228 ****
of lines and characters we added, if any... **/
FILE *myfd;
! char myfname[SLEN], buffer[SLEN];
register int n;
register int lines = 0, nchars = 0;
! for ( n = 0 ; whitespace(filename[n]) ; n++ );
! /** expand any shell variables, '~' or other notation... **/
! /* temp copy of filename to buffer since expand_env is destructive */
! strcpy(buffer, &filename[n]);
! expand_env(myfname, buffer);
! if (strlen(myfname) == 0) {
Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmNoFilenameSpecified,
"\n\r(No filename specified for file read! Continue.)\n\r"), 0);
return;
}
! if ((myfd = fopen(myfname,"r")) == NULL) {
Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmCouldntReadFile,
! "\n\r(Couldn't read file '%s'! Continue.)\n\r"), 1,
! myfname);
return;
}
--- 264,288 ----
of lines and characters we added, if any... **/
FILE *myfd;
! char exp_fname[SLEN], buffer[SLEN];
register int n;
register int lines = 0, nchars = 0;
! while (whitespace(*filename))
! ++filename;
! /** expand any shell variables or leading '~' **/
! (void) expand_env(exp_fname, filename, sizeof(exp_fname));
! if (exp_fname[0] == '\0') {
Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmNoFilenameSpecified,
"\n\r(No filename specified for file read! Continue.)\n\r"), 0);
return;
}
! if ((myfd = fopen(exp_fname,"r")) == NULL) {
Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmCouldntReadFile,
! "\n\r(Couldn't read file '%s'! Continue.)\n\r"), 1, exp_fname);
return;
}
***************
*** 251,257 ****
if (show_user_filename)
Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmAddedFromFile,
! "from file %s. Continue.)\n\r"), 1, myfname);
else
Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmAddedToMessage,
"to message. Continue.)\n\r"), 0);
--- 311,317 ----
if (show_user_filename)
Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmAddedFromFile,
! "from file %s. Continue.)\n\r"), 1, exp_fname);
else
Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmAddedToMessage,
"to message. Continue.)\n\r"), 0);
***************
*** 542,548 ****
sprintf(buffer, "%s %s", editor, filename);
}
! chown(filename, userid, groupid); /* file was owned by root! */
if (( old_raw = RawState()) == ON)
Raw(OFF);
--- 602,608 ----
sprintf(buffer, "%s %s", editor, filename);
}
! (void) elm_chown(filename, userid, groupid);
if (( old_raw = RawState()) == ON)
Raw(OFF);
***************
*** 610,619 ****
"(Continue entering message. Type ^D or '.' on a line by itself to end.)\n\r");
}
! if ((edit_fd = fopen(filename, "a+")) == NULL) {
err = errno;
sprintf(buffer, catgets(elm_msg_cat, ElmSet, ElmCouldntOpenAppend,
! "Couldn't open %s for appending [%s]."),
filename, error_description(err));
Write_to_screen(buffer, 0);
dprint(1, (debugfile,
--- 670,679 ----
"(Continue entering message. Type ^D or '.' on a line by itself to end.)\n\r");
}
! if ((edit_fd = fopen(filename, "r+")) == NULL) {
err = errno;
sprintf(buffer, catgets(elm_msg_cat, ElmSet, ElmCouldntOpenAppend,
! "Couldn't open %s for update [%s]."),
filename, error_description(err));
Write_to_screen(buffer, 0);
dprint(1, (debugfile,
***************
*** 622,627 ****
--- 682,690 ----
return(1);
}
+ /* Skip past any existing text */
+ fseek(edit_fd, 0, SEEK_END);
+
/** is there already text in this file? **/
if (fsize(edit_fd) > 0L)
Index: src/reply.c
Prereq: 5.12
*** ../elm2.4/src/reply.c Sun Apr 11 23:02:06 1993
--- src/reply.c Tue Aug 3 15:29:18 1993
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: reply.c,v 5.12 1993/04/12 03:02:05 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.12 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: reply.c,v 5.15 1993/08/03 19:28:39 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.15 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,56 ----
*
*******************************************************************************
* $Log: reply.c,v $
+ * Revision 5.15 1993/08/03 19:28:39 syd
+ * Elm tries to replace the system toupper() and tolower() on current
+ * BSD systems, which is unnecessary. Even worse, the replacements
+ * collide during linking with routines in isctype.o. This patch adds
+ * a Configure test to determine whether replacements are really needed
+ * (BROKE_CTYPE definition). The <ctype.h> header file is now included
+ * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled
+ * there. Inclusion of <ctype.h> was removed from *all* the individual
+ * files, and the toupper() and tolower() routines in lib/opt_utils.c
+ * were dropped.
+ * From:
[email protected] (Chip Rosenthal)
+ *
+ * Revision 5.14 1993/07/20 02:05:17 syd
+ * A long-standing bug of handling replies to VMS systems.
+ * Original "From: " -line is of format:
+ * From: "NAME \"Real Name\"" <USERNAME@vms-system>
+ * (PMDF mailer)
+ * Anyway, parse_arpa_who() strips quotes too cleanly
+ * resulting data:
+ * NAME \"Real Name\
+ * which, when put into parenthesis, becomes:
+ * (NAME \"Real Name\)
+ * which in its turn lacks closing `)'
+ * Patch of lib/parsarpwho.c fixes that.
+ * strtokq() started one position too late to search for next double-quote (") char.
+ * Another one-off (chops off trailing comment character, quote or not..) in src/reply.c
+ * From: Matti Aarnio <
[email protected]>
+ *
+ * Revision 5.13 1993/06/10 03:02:46 syd
+ * break_down_tolist() tried to blindly split address lists at "," which
+ * caused bogus results with addreses that had a comma inside a comment
+ * or quoted text, such as "user@domain (Last, First)". This patch steps
+ * through the address in quanta of RFC-822 tokens when searching for a
+ * delimiting comma. It also adds "rfc822_toklen()" to the library to
+ * get that length.
+ * From:
[email protected] (Chip Rosenthal)
+ *
* Revision 5.12 1993/04/12 03:02:05 syd
* If a To: or Cc: line is split in a comment, that is between ( and ),
* get_and_expand_everyone won't parse that correctly.
***************
*** 79,89 ****
#include "headers.h"
#include "s_elm.h"
#include <errno.h>
- #include <ctype.h>
-
- #ifdef BSD
- #undef tolower
- #endif
/** Note that this routine generates automatic header information
for the subject and (obviously) to lines, but that these can
--- 116,121 ----
***************
*** 609,619 ****
buffer[loc++] = buf[(*iindex)++]; /* Copy final " */
}
!
! while (buf[*iindex] != ',' && buf[*iindex] != '\0')
! buffer[loc++] = buf[(*iindex)++];
!
! (*iindex)++;
buffer[loc] = '\0';
while (whitespace(buffer[loc])) /* remove trailing whitespace */
--- 641,664 ----
buffer[loc++] = buf[(*iindex)++]; /* Copy final " */
}
! /*
! * Previously, we just went looking for a "," to seperate the
! * addresses. This meant that addresses like:
! *
! *
[email protected] (LastName, Firstname)
! *
! * got split right down the middle. The following was changed
! * to step through the address in quanta of RFC-822 tokens.
! * That fixes the bug, but this routine is still incurably ugly.
! */
! i = *iindex;
! while (buf[i] != ',' && buf[i] != '\0') {
! len = rfc822_toklen(buf+i);
! strncpy(buffer+loc, buf+i, len);
! loc += len;
! i += len;
! }
! *iindex = i + (buf[i] != '\0' ? 1 : 0);
buffer[loc] = '\0';
while (whitespace(buffer[loc])) /* remove trailing whitespace */
***************
*** 649,659 ****
for (loc = 0, len = strlen(buffer);buffer[loc] != '<' && loc < len; loc++)
/* get to the opening comment character... */ ;
while (whitespace(buffer[loc])) loc--; /* back up */
/** get the comment field... **/
comment[0] = '(';
! for (i=1; i < loc; i++)
comment[i] = buffer[i-1];
comment[i++] = ')';
comment[i] = '\0';
--- 694,705 ----
for (loc = 0, len = strlen(buffer);buffer[loc] != '<' && loc < len; loc++)
/* get to the opening comment character... */ ;
while (whitespace(buffer[loc])) loc--; /* back up */
+ if (loc >= 0 && !whitespace(buffer[loc])) loc++; /* And fwd again! */
/** get the comment field... **/
comment[0] = '(';
! for (i=1; i <= loc; i++)
comment[i] = buffer[i-1];
comment[i++] = ')';
comment[i] = '\0';
Index: src/save_opts.c
Prereq: 5.2
*** ../elm2.4/src/save_opts.c Sun Apr 11 23:10:54 1993
--- src/save_opts.c Sun Sep 26 21:52:08 1993
***************
*** 1,8 ****
! static char rcsid[] = "@(#)$Id: save_opts.c,v 5.2 1993/04/12 03:10:54 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.2 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
--- 1,8 ----
! static char rcsid[] = "@(#)$Id: save_opts.c,v 5.7 1993/09/27 01:51:38 syd Exp $";
/*******************************************************************************
! * The Elm Mail System - $Revision: 5.7 $ $State: Exp $
*
* Copyright (c) 1988-1992 USENET Community Trust
* Copyright (c) 1986,1987 Dave Taylor
***************
*** 14,19 ****
--- 14,41 ----
*
*******************************************************************************
* $Log: save_opts.c,v $
+ * Revision 5.7 1993/09/27 01:51:38 syd
+ * Add elm_chown to consolidate for Xenix not allowing -1
+ * From: Syd
+ *
+ * Revision 5.6 1993/08/23 03:26:24 syd
+ * Try setting group id separate from user id in chown to
+ * allow restricted systems to change group id of file
+ * From: Syd
+ *
+ * Revision 5.5 1993/08/10 18:54:45 syd
+ * Elm was failing to write an empty "alternatives" list to elmrc.
+ * From:
[email protected] (Chip Rosenthal)
+ *
+ * Revision 5.4 1993/08/03 19:03:52 syd
+ * "*clear-weed-list*" in elmrc was wiped out when one saved the options in elm.
+ * From:
[email protected] (Jan Djarv)
+ *
+ * Revision 5.3 1993/06/10 02:55:34 syd
+ * Write options to elmrc even if their values are empty strings.
+ * Rationalize code that reads and writes weedouts and alternates.
+ * From: chip%
[email protected]
+ *
* Revision 5.2 1993/04/12 03:10:54 syd
* The onoff macro assumes a boolean option only has values 1 or 0.
* This is not true for forms option (may be 2 == MAYBE).
***************
*** 86,92 ****
if (rename(newfname, oldfname) < 0)
dprint(2, (debugfile, "Unable to rename %s to %s\n",
newfname, oldfname));
! (void) chown(oldfname, userid, groupid);
}
--- 108,114 ----
if (rename(newfname, oldfname) < 0)
dprint(2, (debugfile, "Unable to rename %s to %s\n",
newfname, oldfname));
! (void) elm_chown(oldfname, userid, groupid);
}
***************
*** 241,247 ****
continue;
local_value = save_info[x].flags & FL_LOCAL;
! s="";
switch(save_info[x].flags & DT_MASK) {
case DT_MLT:
case DT_SYN:
--- 263,269 ----
continue;
local_value = save_info[x].flags & FL_LOCAL;
! s = NULL;
switch(save_info[x].flags & DT_MASK) {
case DT_MLT:
case DT_SYN:
***************
*** 260,292 ****
break;
case DT_WEE:
! { int len = 0 ,i;
add_comment(x, newelmrc);
if (!local_value)
fprintf(newelmrc, "### ");
! fprintf(newelmrc, "%s = ", save_info[x].name);
! len = strlen(save_info[x].name) + 4;
!
! for (i = 0; i < weedcount && strcmp(weedlist[i], "*end-of-defaults*") !=0; i++)
! /* intentional null loop body */;
! while (i < weedcount && equal(weedlist[i], "*end-of-defaults*"))
i++;
! while (i < weedcount) {
! if (strlen(weedlist[i]) + len > 78) {
if (local_value)
fprintf(newelmrc, "\n\t");
else
fprintf(newelmrc, "\n###\t");
len = 8;
}
! fprintf(newelmrc, "\"%s\" ", weedlist[i]);
! len += strlen(weedlist[i]) + 4;
! ++i;
}
! fprintf(newelmrc, "\t\"*end-of-user-headers*\"\n");
}
break;
--- 282,333 ----
break;
case DT_WEE:
! { int len, i;
! char *w;
add_comment(x, newelmrc);
if (!local_value)
fprintf(newelmrc, "### ");
! fprintf(newelmrc, "%s =", save_info[x].name);
! len = strlen(save_info[x].name) + 6;
! i = 0;
! while (i < weedcount
! && istrcmp(weedlist[i], "*end-of-defaults*"))
i++;
+ while (i < weedcount
+ && !istrcmp(weedlist[i], "*end-of-defaults*"))
+ i++;
+ if (i == 1) {
+ /* end-of-defaults in the first position means
+ ** that there are no defaults, i.e.
+ ** a clear-weed-list has been done.
+ */
+ fprintf(newelmrc, " \"*clear-weed-list*\"");
+ len += 20;
+ }
! while (i <= weedcount) {
! char *w;
!
! w = (i < weedcount) ? weedlist[i]
! : "*end-of-user-headers*";
! if (strlen(w) + len > 72) {
if (local_value)
fprintf(newelmrc, "\n\t");
else
fprintf(newelmrc, "\n###\t");
len = 8;
}
! else {
! fprintf(newelmrc, " ");
! ++len;
! }
! fprintf(newelmrc, "\"%s\"", w);
! len += strlen(w) + 3;
! i++;
}
! fprintf(newelmrc, "\n");
}
break;
***************
*** 295,331 ****
int len=0;
alts = *SAVE_INFO_ALT(x);
- if (!alts) break;
-
add_comment(x, newelmrc);
if (!local_value)
fprintf(newelmrc, "### ");
! fprintf(newelmrc, "%s = ", save_info[x].name);
! len = strlen(save_info[x].name) + 4;
for ( ;alts; alts = alts->next) {
! if (strlen(alts->address) + len > 78) {
if (local_value)
fprintf(newelmrc, "\n\t");
else
fprintf(newelmrc, "\n###\t");
len = 8;
}
! fprintf(newelmrc, "%s ", alts->address);
! len += strlen(alts->address) + 2;
}
}
- fprintf(newelmrc,"\n");
break;
}
! if (*s) {
add_comment(x, newelmrc);
! if (local_value)
! fprintf(newelmrc, "%s = %s\n", save_info[x].name, s);
! else
! fprintf(newelmrc, "### %s = %s\n", save_info[x].name, s);
! }
}
fclose(newelmrc);
if ( elminfo_fd != NULL ) {
--- 336,373 ----
int len=0;
alts = *SAVE_INFO_ALT(x);
add_comment(x, newelmrc);
if (!local_value)
fprintf(newelmrc, "### ");
! fprintf(newelmrc, "%s =", save_info[x].name);
! len = strlen(save_info[x].name) + 6;
for ( ;alts; alts = alts->next) {
! if (strlen(alts->address) + len > 72) {
if (local_value)
fprintf(newelmrc, "\n\t");
else
fprintf(newelmrc, "\n###\t");
len = 8;
}
! else {
! fprintf(newelmrc, " ");
! ++len;
! }
! fprintf(newelmrc, "%s", alts->address);
! len += strlen(alts->address);
}
+ fprintf(newelmrc,"\n");
}
break;
}
! if (s) {
add_comment(x, newelmrc);
! if (!local_value)
! fprintf(newelmrc, "### ");
! fprintf(newelmrc, "%s = %s\n", save_info[x].name, s);
}
+ }
fclose(newelmrc);
if ( elminfo_fd != NULL ) {