MH 6.7 Updates - part 10/14
John Romine
mh at beanie.ICS.UCI.EDU
Sun Apr 15 04:16:12 AEST 1990
These are patches for MH 6.6 to bring it up to the current release MH
6.7. If you can FTP, you should instead retrieve the current release
(from ics.uci.edu [128.195.1.1] in pub/mh). See the announcement in
comp.mail.mh for all the details. A document descibing the changes
from MH 6.6 can also be found in comp.mail.mh.
There are fourteen parts to these patches; you *must* have all the
parts to compile MH. It will not work if you try to compile an
intermediate version.
Save this message, extract the file below and apply it with "patch -p"
from the top of your MH source tree:
cd mh-6.6/
patch -p < MH.6.6.n
If you have modified your source tree, you'll have to merge your local
changes in after you apply these patches to the original sources.
/JLR
: This is a shar archive. Extract with sh, not csh.
: This archive ends with exit, so do not worry about trailing junk.
echo 'Extracting MH.6.6.9'
sed 's/^X//' > MH.6.6.9 << '+ END-OF-FILE MH.6.6.9'
XPrereq: patch.8
X*** Patchlevel.orig Thu Apr 12 15:58:25 1990
X--- Patchlevel Thu Apr 12 15:58:42 1990
X***************
X*** 1 ****
X! MH.6.6 patch.8
X--- 1 ----
X! MH.6.6 patch.9
X*** ../mh-6.6.0/./uip/folder.c Thu Oct 29 15:02:22 1987
X--- ./uip/folder.c Thu Apr 5 16:03:25 1990
X***************
X*** 1,4 ****
X--- 1,7 ----
X /* folder(s).c - report on folders */
X+ #ifndef lint
X+ static char ident[] = "@(#)$Id: folder.c,v 2.4 90/04/05 14:56:54 sources Exp $";
X+ #endif lint
X
X #include "../h/mh.h"
X #include "../h/local.h"
X***************
X*** 5,10 ****
X--- 8,15 ----
X #include <errno.h>
X #include <stdio.h>
X
X+ static dodir(), addir(), addfold(), dother();
X+ static int pfold(), sfold(), compare();
X /* */
X
X static struct swit switches[] = {
X***************
X*** 25,55 ****
X "pack", 0,
X #define NPACKSW 6
X "nopack", 0,
X
X! #define RECURSW 7
X "recurse", 0,
X! #define NRECRSW 8
X "norecurse", 0,
X
X! #define TOTALSW 9
X "total", 0,
X! #define NTOTLSW 10
X "nototal", 0,
X
X! #define PRNTSW 11
X "print", 0,
X! #define NPRNTSW 12
X "noprint", 0,
X! #define LISTSW 13
X "list", 0,
X! #define NLISTSW 14
X "nolist", 0,
X! #define PUSHSW 15
X "push", 0,
X! #define POPSW 16
X "pop", 0,
X
X! #define HELPSW 17
X "help", 4,
X
X NULL, NULL
X--- 30,64 ----
X "pack", 0,
X #define NPACKSW 6
X "nopack", 0,
X+ #define VERBSW 7
X+ "verbose", 0,
X+ #define NVERBSW 8
X+ "noverbose", 0,
X
X! #define RECURSW 9
X "recurse", 0,
X! #define NRECRSW 10
X "norecurse", 0,
X
X! #define TOTALSW 11
X "total", 0,
X! #define NTOTLSW 12
X "nototal", 0,
X
X! #define PRNTSW 13
X "print", 0,
X! #define NPRNTSW 14
X "noprint", 0,
X! #define LISTSW 15
X "list", 0,
X! #define NLISTSW 16
X "nolist", 0,
X! #define PUSHSW 17
X "push", 0,
X! #define POPSW 18
X "pop", 0,
X
X! #define HELPSW 19
X "help", 4,
X
X NULL, NULL
X***************
X*** 61,66 ****
X--- 70,76 ----
X
X static int fshort = 0;
X static int fpack = 0;
X+ static int fverb = 0;
X static int fheader = 0;
X static int frecurse = 0;
X static int ftotonly = 0;
X***************
X*** 151,156 ****
X--- 161,173 ----
X fpack = 0;
X continue;
X
X+ case VERBSW:
X+ fverb++;
X+ continue;
X+ case NVERBSW:
X+ fverb = 0;
X+ continue;
X+
X case RECURSW:
X frecurse++;
X continue;
X***************
X*** 459,464 ****
X--- 476,483 ----
X if (msgnum != hole) {
X (void) strcpy (newmsg, m_name (hole));
X (void) strcpy (oldmsg, m_name (msgnum));
X+ if (fverb)
X+ printf ("message %s becomes %s\n", oldmsg, newmsg);
X if (rename (oldmsg, newmsg) == NOTOK)
X adios (newmsg, "unable to rename %s to", oldmsg);
X if (msgnum == mp -> curmsg)
X***************
X*** 490,496 ****
X--- 509,519 ----
X register char *base,
X *cp;
X struct stat st;
X+ #ifdef SYS5DIR
X+ register struct dirent *dp;
X+ #else SYS5DIR
X register struct direct *dp;
X+ #endif SYS5DIR
X register DIR * dd;
X
X cp = name + strlen (name);
X***************
X*** 505,511 ****
X }
X while (dp = readdir (dd))
X if (strcmp (dp -> d_name, ".") && strcmp (dp -> d_name, "..")) {
X! if (cp + dp -> d_namlen + 2 >= name + BUFSIZ)
X continue;
X (void) strcpy (cp, dp -> d_name);
X if (stat (name, &st) != NOTOK && (st.st_mode & S_IFMT) == S_IFDIR)
X--- 528,538 ----
X }
X while (dp = readdir (dd))
X if (strcmp (dp -> d_name, ".") && strcmp (dp -> d_name, "..")) {
X! #ifdef SYS5DIR
X! if (cp + dp -> d_reclen + 2 >= name + BUFSIZ)
X! #else SYS5DIR
X! if (cp + strlen (dp -> d_name) + 2 >= name + BUFSIZ)
X! #endif SYS5DIR
X continue;
X (void) strcpy (cp, dp -> d_name);
X if (stat (name, &st) != NOTOK && (st.st_mode & S_IFMT) == S_IFDIR)
X*** ../mh-6.6.0/./uip/post.c Thu May 5 11:11:18 1988
X--- ./uip/post.c Thu Apr 5 16:02:55 1990
X***************
X*** 1,4 ****
X--- 1,7 ----
X /* post.c - enter messages into the transport system */
X+ #ifndef lint
X+ static char ident[] = "@(#)$Id: post.c,v 2.8 90/04/05 15:35:20 sources Exp $";
X+ #endif lint
X
X #include "../h/mh.h"
X #include "../h/addrsbr.h"
X***************
X*** 122,127 ****
X--- 125,133 ----
X #define SNOOPSW 29
X "snoop", -5,
X
X+ #define FILLSW 30
X+ "fill-in file", -7,
X+
X NULL, NULL
X };
X
X***************
X*** 142,147 ****
X--- 148,154 ----
X #define HFCC 0x0080 /* FCC: type header */
X #define HNIL 0x0100 /* okay for this header not to have addrs */
X #define HIGN 0x0200 /* ignore this header */
X+ #define HDCC 0x0400 /* another undocumented feature */
X
X unsigned int set;
X #define MFRM 0x0001 /* we've seen a From: */
X***************
X*** 164,169 ****
X--- 171,177 ----
X "To", HADR | HTRY, MVIS,
X "cc", HADR | HTRY, MVIS,
X "Bcc", HADR | HTRY | HBCC | HNIL, MINV,
X+ "Dcc", HADR | HTRY | HDCC | HNIL, MVIS, /* sorta cc & bcc combined */
X "Message-ID", HBAD, NULL,
X "Fcc", HFCC, NULL,
X
X***************
X*** 228,234 ****
X
X static long clock = 0L; /* the time we started (more or less) */
X
X! static int (*hstat) (), (*istat) (), (*qstat) (), (*tstat) ();
X
X static char tmpfil[BUFSIZ];
X static char bccfil[BUFSIZ];
X--- 236,242 ----
X
X static long clock = 0L; /* the time we started (more or less) */
X
X! static TYPESIG (*hstat) (), (*istat) (), (*qstat) (), (*tstat) ();
X
X static char tmpfil[BUFSIZ];
X static char bccfil[BUFSIZ];
X***************
X*** 284,291 ****
X--- 292,315 ----
X static int encryptsw = 0; /* encrypt it */
X
X
X+ #ifdef WP
X+ extern int do_wp; /* fill-in white pages queries */
X+ #endif
X+ static char *fill_in = NULLCP;
X+
X+
X long lseek (), time ();
X
X+ static putfmt(), start_headers(), finish_headers(), putgrp(), pl();
X+ static anno(), insert_foc(), make_bcc_file(), verify_all_addresses();
X+ static chkadr(), do_addresses(), do_text(), do_an_address(), sigon();
X+ static sigoff(), p_refile(), fcc(), die(), insert_fcc();
X+ static int get_header(), putadr(), insert(), annoaux();
X+ #ifdef TMA
X+ static postplain();
X+ #else
X+ static post();
X+ #endif !TMA
X /* MAIN */
X
X /* ARGSUSED */
X***************
X*** 486,491 ****
X--- 510,522 ----
X snoop++;
X continue;
X #endif SENDMTS
X+
X+ case FILLSW:
X+ #ifdef WP
X+ if (!(fill_in = *argp++) || *fill_in == '-')
X+ adios (NULLCP, "missing argument to %s", argp[-2]);
X+ #endif
X+ continue;
X }
X if (msg)
X adios (NULLCP, "only one message at a time!");
X***************
X*** 494,499 ****
X--- 525,533 ----
X }
X
X (void) alias (AliasFile);
X+ #ifdef WP
X+ do_wp++;
X+ #endif
X
X /* */
X
X***************
X*** 534,540 ****
X else
X #endif MHMTS
X if (whomsw) {
X! if ((out = fopen ("/dev/null", "w")) == NULL)
X adios ("/dev/null", "unable to open");
X }
X else {
X--- 568,574 ----
X else
X #endif MHMTS
X if (whomsw) {
X! if ((out = fopen (fill_in ? fill_in : "/dev/null", "w")) == NULL)
X adios ("/dev/null", "unable to open");
X }
X else {
X***************
X*** 575,581 ****
X case BODY:
X case BODYEOF:
X finish_headers (out);
X! if (whomsw)
X break;
X fprintf (out, "\n%s", buf);
X while (state == BODY) {
X--- 609,615 ----
X case BODY:
X case BODYEOF:
X finish_headers (out);
X! if (whomsw && !fill_in)
X break;
X fprintf (out, "\n%s", buf);
X while (state == BODY) {
X***************
X*** 652,658 ****
X tmastop ();
X #endif TMA
X
X! refile (tmpfil);
X
X #ifdef MHMTS
X if (!deliver)
X--- 686,692 ----
X tmastop ();
X #endif TMA
X
X! p_refile (tmpfil);
X
X #ifdef MHMTS
X if (!deliver)
X***************
X*** 699,709 ****
X }
X
X hdr = &hdrtab[i];
X! if (hdr -> flags & HIGN)
X return;
X if (hdr -> flags & HBAD) {
X! advise (NULLCP, "illegal header line -- %s:", name);
X! badmsg++;
X return;
X }
X msgflags |= (hdr -> set & ~(MVIS | MINV));
X--- 733,750 ----
X }
X
X hdr = &hdrtab[i];
X! if (hdr -> flags & HIGN) {
X! if (fill_in)
X! fprintf (out, "%s: %s", name, str);
X return;
X+ }
X if (hdr -> flags & HBAD) {
X! if (fill_in)
X! fprintf (out, "%s: %s", name, str);
X! else {
X! advise (NULLCP, "illegal header line -- %s:", name);
X! badmsg++;
X! }
X return;
X }
X msgflags |= (hdr -> set & ~(MVIS | MINV));
X***************
X*** 711,716 ****
X--- 752,762 ----
X if (hdr -> flags & HSUB)
X subject = subject ? add (str, add ("\t", subject)) : getcpy (str);
X if (hdr -> flags & HFCC) {
X+ if (fill_in) {
X+ fprintf (out, "%s: %s", name, str);
X+ return;
X+ }
X+
X if (cp = rindex (str, '\n'))
X *cp = NULL;
X for (cp = pp = str; cp = index (pp, ','); pp = cp) {
X***************
X*** 759,765 ****
X
X nameoutput = linepos = 0;
X (void) sprintf (namep, "%s%s",
X! (hdr -> flags & HMNG) ? "Original-" : "", name);
X
X for (grp = 0, mp = tmpaddrs.m_next; mp; mp = np)
X if (mp -> m_nohost) { /* also used to test (hdr -> flags & HTRY) */
X--- 805,812 ----
X
X nameoutput = linepos = 0;
X (void) sprintf (namep, "%s%s",
X! !fill_in && (hdr -> flags & HMNG) ? "Original-" : "",
X! name);
X
X for (grp = 0, mp = tmpaddrs.m_next; mp; mp = np)
X if (mp -> m_nohost) { /* also used to test (hdr -> flags & HTRY) */
X***************
X*** 810,817 ****
X advise (NULLCP, "%s: field does not allow groups", name);
X badmsg++;
X }
X! if (linepos)
X (void) putc ('\n', out);
X }
X
X /* */
X--- 857,867 ----
X advise (NULLCP, "%s: field does not allow groups", name);
X badmsg++;
X }
X! if (linepos) {
X! if (fill_in && grp > 0)
X! (void) putc (';', out);
X (void) putc ('\n', out);
X+ }
X }
X
X /* */
X***************
X*** 942,948 ****
X
X if (mp -> m_mbox == NULL || ((flags & HTRY) && !insert (mp)))
X return 0;
X! if ((flags & HBCC) || mp -> m_ingrp)
X return 1;
X
X if (!nameoutput) {
X--- 992,998 ----
X
X if (mp -> m_mbox == NULL || ((flags & HTRY) && !insert (mp)))
X return 0;
X! if (!fill_in && ((flags & (HBCC|HDCC)) || mp -> m_ingrp))
X return 1;
X
X if (!nameoutput) {
X***************
X*** 953,959 ****
X if (*aka && mp -> m_type != UUCPHOST && !mp -> m_pers)
X mp -> m_pers = getcpy (aka);
X if (format) {
X! if (mp -> m_gname)
X (void) sprintf (cp = buffer, "%s;", mp -> m_gname);
X else
X cp = adrformat (mp);
X--- 1003,1009 ----
X if (*aka && mp -> m_type != UUCPHOST && !mp -> m_pers)
X mp -> m_pers = getcpy (aka);
X if (format) {
X! if (mp -> m_gname && !fill_in)
X (void) sprintf (cp = buffer, "%s;", mp -> m_gname);
X else
X cp = adrformat (mp);
X***************
X*** 987,1004 ****
X int len;
X char *cp;
X
X! if (flags & HBCC)
X return;
X
X if (!nameoutput) {
X fprintf (out, "%s: ", name);
X linepos += (nameoutput = strlen (name) + 2);
X }
X
X! cp = concat (group, ";", NULLCP);
X len = strlen (cp);
X
X! if (linepos != nameoutput)
X if (len + linepos + 2 > outputlinelen) {
X fprintf (out, ",\n%*s", nameoutput, "");
X linepos = nameoutput;
X--- 1037,1056 ----
X int len;
X char *cp;
X
X! if (!fill_in && (flags & HBCC))
X return;
X
X if (!nameoutput) {
X fprintf (out, "%s: ", name);
X linepos += (nameoutput = strlen (name) + 2);
X+ if (fill_in)
X+ linepos -= strlen (group);
X }
X
X! cp = fill_in ? group : concat (group, ";", NULLCP);
X len = strlen (cp);
X
X! if (linepos > nameoutput)
X if (len + linepos + 2 > outputlinelen) {
X fprintf (out, ",\n%*s", nameoutput, "");
X linepos = nameoutput;
X***************
X*** 2095,2101 ****
X
X /* FCC INTERACTION */
X
X! static refile (file)
X register char *file;
X {
X register int i;
X--- 2147,2153 ----
X
X /* FCC INTERACTION */
X
X! static p_refile (file)
X register char *file;
X {
X register int i;
X***************
X*** 2432,2438 ****
X from;
X {
X int i;
X! int (*pstat) ();
X char addr[BUFSIZ],
X buffer[BUFSIZ];
X register FILE *fp;
X--- 2484,2490 ----
X from;
X {
X int i;
X! TYPESIG (*pstat) ();
X char addr[BUFSIZ],
X buffer[BUFSIZ];
X register FILE *fp;
X*** ../mh-6.6.0/./uip/rmf.c Thu Oct 29 15:02:44 1987
X--- ./uip/rmf.c Thu Apr 5 16:03:26 1990
X***************
X*** 1,4 ****
X--- 1,7 ----
X /* rmf.c - remove a folder */
X+ #ifndef lint
X+ static char ident[] = "@(#)$Id: rmf.c,v 2.2 90/04/05 14:57:11 sources Exp $";
X+ #endif lint
X
X #include "../h/mh.h"
X #include "../h/local.h"
X***************
X*** 18,23 ****
X--- 21,28 ----
X NULL, NULL
X };
X
X+ static int rmf();
X+ static rma();
X /* */
X
X /* ARGSUSED */
X***************
X*** 129,135 ****
X--- 134,144 ----
X others;
X register char *maildir;
X char cur[BUFSIZ];
X+ #ifdef SYS5DIR
X+ register struct dirent *dp;
X+ #else SYS5DIR
X register struct direct *dp;
X+ #endif SYS5DIR
X register DIR * dd;
X
X #ifdef COMPAT
X*** ../mh-6.6.0/./uip/rcvtty.c Thu Oct 29 15:02:19 1987
X--- ./uip/rcvtty.c Thu Apr 5 16:03:47 1990
X***************
X*** 1,4 ****
X--- 1,7 ----
X /* rcvtty.c - a rcvmail program (a lot like rcvalert) handling IPC ttys */
X+ #ifndef lint
X+ static char ident[] = "@(#)$Id: rcvtty.c,v 1.5 90/04/05 15:02:11 sources Exp $";
X+ #endif lint
X
X #ifndef BSD42
X #undef TTYD
X***************
X*** 14,24 ****
X--- 17,48 ----
X #endif not TTYD
X
X /* */
X+ #define SCANFMT \
X+ "%2(hour{dtimenow}):%02(min{dtimenow}): %5(size) %<{encrypted}E%>\
X+ %<(mymbox{from})To:%14(friendly{to})%|%17(friendly{from})%> \
X+ %{subject}%<{body}<<%{body}>>%>"
X
X static struct swit switches[] = {
X #define HELPSW 0
X "help", 4,
X
X+ #define BIFFSW 1
X+ "biff", 0,
X+
X+ #define FORMSW 2
X+ "form formatfile", 0,
X+ #define FMTSW 3
X+ "format string", 5,
X+
X+ #define NLSW 4
X+ "newline", 0,
X+ #define NNLSW 5
X+ "nonewline", 0,
X+ #define BELSW 6
X+ "bell", 0,
X+ #define NBELSW 7
X+ "nobell", 0,
X+
X NULL, NULL
X };
X
X***************
X*** 29,34 ****
X--- 53,67 ----
X long lseek ();
X char *getusr ();
X
X+ static int message_fd(), header_fd();
X+ static alert();
X+
X+ static int bell = 1;
X+ static int newline = 1;
X+ static int biff = 0;
X+ static char *form = NULL;
X+ static char *format = NULL;
X+
X /* */
X
X /* ARGSUSED */
X***************
X*** 78,83 ****
X--- 111,145 ----
X (void) sprintf (buf, "%s [command ...]", invo_name);
X help (buf, switches);
X done (1);
X+
X+ case BIFFSW:
X+ biff = 1;
X+ continue;
X+
X+ case FORMSW:
X+ if (!(form = *argp++) || *form == '-')
X+ adios (NULLCP, "missing argument to %s", argp[-2]);
X+ format = NULL;
X+ continue;
X+ case FMTSW:
X+ if (!(format = *argp++) || *format == '-')
X+ adios (NULLCP, "missing argument to %s", argp[-2]);
X+ form = NULL;
X+ continue;
X+
X+ case NLSW:
X+ newline = 1;
X+ continue;
X+ case NNLSW:
X+ newline = 0;
X+ continue;
X+ case BELSW:
X+ bell = 1;
X+ continue;
X+ case NBELSW:
X+ bell = 0;
X+ continue;
X+
X }
X vec[vecp++] = cp;
X }
X***************
X*** 199,206 ****
X (void) unlink (tmpfil);
X
X rewind (stdin);
X! (void) scan (stdin, 0, 0, NULLCP, 0, 0, 0, 0L, 0);
X (void) write (fd, scanl, strlen (scanl));
X
X return fd;
X }
X--- 261,272 ----
X (void) unlink (tmpfil);
X
X rewind (stdin);
X! (void) scan (stdin, 0, 0, new_fs (form, format, SCANFMT), 0, 0, 0, 0L, 0);
X! if ( newline )
X! (void) write (fd, "\n\r", 2);
X (void) write (fd, scanl, strlen (scanl));
X+ if ( bell )
X+ (void) write (fd, "\007", 1);
X
X return fd;
X }
X***************
X*** 219,225 ****
X struct stat st;
X
X (void) sprintf (ttyspec, "/dev/%s", tty);
X! if (stat (ttyspec, &st) == NOTOK || (st.st_mode & 02) == 0)
X return;
X
X switch (setjmp (myctx)) {
X--- 285,298 ----
X struct stat st;
X
X (void) sprintf (ttyspec, "/dev/%s", tty);
X! if (stat (ttyspec, &st) == NOTOK ||
X! (st.st_mode & (biff ? S_IEXEC :
X! #ifdef BSD43
X! (S_IWRITE >> 3)
X! #else /* BSD43 */
X! 02
X! #endif /* BSD43 */
X! )) == 0)
X return;
X
X switch (setjmp (myctx)) {
X*** ../mh-6.6.0/./uip/msh.c Thu Oct 29 15:02:30 1987
X--- ./uip/msh.c Thu Apr 5 16:02:57 1990
X***************
X*** 1,4 ****
X--- 1,7 ----
X /* msh.c - The MH shell (sigh) */
X+ #ifndef lint
X+ static char ident[] = "@(#)$Id: msh.c,v 2.5 90/04/05 14:56:36 sources Exp $";
X+ #endif lint
X
X /* TODO:
X Keep more status information in maildrop map
X***************
X*** 18,24 ****
X--- 21,29 ----
X #include <sgtty.h>
X #else SYS5
X #include <termio.h>
X+ #ifndef NOIOCTLH
X #include <sys/ioctl.h>
X+ #endif NOIOCTLH
X #endif SYS5
X #include <pwd.h>
X #include <setjmp.h>
X***************
X*** 112,118 ****
X static jmp_buf peerenv;
X
X void padios (), padvise ();
X! int alrmser ();
X
X
X #ifdef BPOP
X--- 117,123 ----
X static jmp_buf peerenv;
X
X void padios (), padvise ();
X! static int alrmser ();
X
X
X #ifdef BPOP
X***************
X*** 149,159 ****
X char *BBoard_ID = "BBoard-ID";/* BBoard-ID constant */
X
X /* SIGNALS */
X! int (*istat) (); /* original SIGINT */
X! static int (*pstat) (); /* current SIGPIPE */
X! int (*qstat) (); /* original SIGQUIT */
X #ifdef SIGTSTP
X! static int (*tstat) (); /* original SIGTSTP */
X #endif SIGTSTP
X int interrupted; /* SIGINT detected */
X int broken_pipe; /* SIGPIPE detected */
X--- 154,164 ----
X char *BBoard_ID = "BBoard-ID";/* BBoard-ID constant */
X
X /* SIGNALS */
X! TYPESIG (*istat) (); /* original SIGINT */
X! static TYPESIG (*pstat) (); /* current SIGPIPE */
X! TYPESIG (*qstat) (); /* original SIGQUIT */
X #ifdef SIGTSTP
X! static TYPESIG (*tstat) (); /* original SIGTSTP */
X #endif SIGTSTP
X int interrupted; /* SIGINT detected */
X int broken_pipe; /* SIGPIPE detected */
X***************
X*** 164,170 ****
X jmp_buf sigenv; /* the environment pointer */
X #endif BSD42
X
X! int intrser (), pipeser (), quitser ();
X
X
X #ifdef SYS5
X--- 169,175 ----
X jmp_buf sigenv; /* the environment pointer */
X #endif BSD42
X
X! static int intrser (), pipeser (), quitser ();
X
X
X #ifdef SYS5
X***************
X*** 171,176 ****
X--- 176,190 ----
X struct passwd *getpwnam ();
X #endif SYS5
X
X+ static int read_map(), read_file(), check_folder(), getargs(), parse();
X+ static int getcmds(), init_io(), initaux_io(), finaux_io(), peerwait();
X+ static int pINI(), pQRY(), pQRY1(), pQRY2(), pCMD(), pFIN();
X+ static int ttyR(), ttyNaux(), winN(), winR(), winX();
X+ static msh(), m_gMsgs(), scanrange(), scanstring(), quit();
X+ static fin_io(), m_init();
X+ #ifdef BPOP
X+ static int read_pop();
X+ #endif
X /* */
X
X /* ARGSUSED */
X***************
X*** 339,345 ****
X--- 353,363 ----
X #ifdef BPOP
X if (pmsh = pmsh1 && pmsh2) {
X cp = getenv ("MHPOPDEBUG");
X+ #ifdef NNTP
X+ if (pop_set (pmsh1, pmsh2, cp && *cp, myname) == NOTOK)
X+ #else NNTP
X if (pop_set (pmsh1, pmsh2, cp && *cp) == NOTOK)
X+ #endif NNTP
X padios (NULLCP, "%s", response);
X if (folder)
X file = folder, folder = NULL;
X***************
X*** 731,745 ****
X if (mp -> msgstats == NULL)
X padios (NULLCP, "unable to allocate messages storage");
X mp -> msgstats = (mp -> msgbase = mp -> msgstats) - mp -> lowoff;
X! if (mp -> msgstats < 0)
X padios (NULLCP, "setup() botch -- you lose big");
X #endif MTR
X #ifdef BPOP
X if (pmsh) {
X for (i = mp -> lowmsg; i <= mp -> hghmsg; i++) {
X Msgs[i].m_top = i;
X mp -> msgstats[i] = EXISTS | VIRTUAL;
X }
X }
X else
X #endif BPOP
X--- 749,770 ----
X if (mp -> msgstats == NULL)
X padios (NULLCP, "unable to allocate messages storage");
X mp -> msgstats = (mp -> msgbase = mp -> msgstats) - mp -> lowoff;
X! if (mp -> msgstats < (short *)0)
X padios (NULLCP, "setup() botch -- you lose big");
X #endif MTR
X #ifdef BPOP
X if (pmsh) {
X+ #ifndef NNTP
X for (i = mp -> lowmsg; i <= mp -> hghmsg; i++) {
X Msgs[i].m_top = i;
X mp -> msgstats[i] = EXISTS | VIRTUAL;
X }
X+ #else NNTP
X+ for (i = mp -> lowmsg; i <= mp -> hghmsg; i++) {
X+ if (Msgs[i].m_top) /* set in read_pop() */
X+ mp -> msgstats[i] = EXISTS | VIRTUAL;
X+ }
X+ #endif NNTP
X }
X else
X #endif BPOP
X***************
X*** 830,835 ****
X--- 855,873 ----
X /* */
X
X #ifdef BPOP
X+ #ifdef NNTP
X+ static int pop_base = 0;
X+
X+ static int pop_statmsg (s)
X+ register char *s;
X+ {
X+ register int i, n;
X+
X+ n = (i = atoi (s)) - pop_base; /* s="nnn header-line..." */
X+ Msgs[n].m_top = Msgs[n].m_bboard_id = i;
X+ }
X+
X+ #endif NNTP
X static int read_pop () {
X int nmsgs,
X nbytes;
X***************
X*** 839,844 ****
X--- 877,886 ----
X
X m_gMsgs (nmsgs);
X
X+ #ifdef NNTP /* this makes read_pop() do some real work... */
X+ pop_base = nbytes - 1; /* nmsgs=last-first+1, nbytes=first */
X+ pop_exists (pop_statmsg);
X+ #endif NNTP
X return nmsgs;
X }
X
X***************
X*** 1109,1114 ****
X--- 1151,1157 ----
X cur = mp -> curmsg;
X
X for (msgnum = mp -> hghmsg; msgnum >= mp -> lowmsg; msgnum--)
X+ if (mp -> msgstats[msgnum] & EXISTS) /* FIX */
X if ((i = readid (msgnum)) > 0 && i < id) {
X cur = msgnum + 1;
X mp -> msgstats[msgnum] &= ~flags;
X*** ../mh-6.6.0/./uip/mhlsbr.c Thu Oct 29 15:02:15 1987
X--- ./uip/mhlsbr.c Thu Apr 5 16:03:31 1990
X***************
X*** 1,4 ****
X--- 1,7 ----
X /* mhlsbr.c - implement the "nifty" message lister */
X+ #ifndef lint
X+ static char ident[] = "@(#)$Id: mhlsbr.c,v 1.14 90/04/05 14:58:08 sources Exp $";
X+ #endif lint
X
X #include "../h/mh.h"
X #include "../h/addrsbr.h"
X***************
X*** 31,36 ****
X--- 34,43 ----
X */
X
X
X+ #ifdef SYS5
X+ #define u_short ushort
X+ #endif SYS5
X+
X #define ONECOMP 0
X #define TWOCOMP 1
X #define BODYCOMP 2
X***************
X*** 76,96 ****
X #define SLEEPSW 12
X "sleep seconds", 0,
X
X! #define HELPSW 13
X "help", 4,
X
X! #define FORW1SW 14
X "forward", -7, /* interface from forw */
X! #define FORW2SW 15
X "forwall", -7, /* .. */
X! #define DGSTSW 16
X "digest list", -6,
X
X- #define DASHSW 17
X- "dashmunging", -4,
X- #define NDASHSW 18
X- "nodashmunging", -6,
X-
X NULL, NULL
X };
X
X--- 83,107 ----
X #define SLEEPSW 12
X "sleep seconds", 0,
X
X! #define DASHSW 13
X! "dashmunging", -4,
X! #define NDASHSW 14
X! "nodashmunging", -6,
X!
X! #define HELPSW 15
X "help", 4,
X
X! #define FORW1SW 16
X "forward", -7, /* interface from forw */
X! #define FORW2SW 17
X "forwall", -7, /* .. */
X! #define DGSTSW 18
X "digest list", -6,
X+ #define VOLUMSW 19
X+ "volume number", -6,
X+ #define ISSUESW 20
X+ "issue number", -5,
X
X NULL, NULL
X };
X
X***************
X*** 210,215 ****
X--- 221,228 ----
X static int sleepsw = NOTOK;
X
X static char *digest = NULL;
X+ static int volume = 0;
X+ static int issue = 0;
X
X static int exitstat = 0;
X static int mhldebug = 0;
X***************
X*** 250,260 ****
X static FP (*mhl_action) () = (FP (*) ()) 0;
X
X
X! void mhladios (), mhldone ();
X! int intrser (), pipeser (), quitser ();
X! char *mcomp_add (), *oneline (), *parse ();
X! struct mcomp *add_queue ();
X
X
X void clear_screen ();
X
X--- 263,276 ----
X static FP (*mhl_action) () = (FP (*) ()) 0;
X
X
X! static void mhladios (), mhldone ();
X! static int intrser (), pipeser (), quitser ();
X! static char *mcomp_add (), *oneline (), *parse ();
X! static struct mcomp *add_queue ();
X
X+ static mhl_format(), evalvar(), process(), mhlfile(), free_queue(), putcomp();
X+ static putstr(), putch(), face_format(), m_popen();
X+ static int ptoi(), ptos(), doface();
X
X void clear_screen ();
X
X***************
X*** 372,377 ****
X--- 388,407 ----
X case DGSTSW:
X if (!(digest = *argp++) || *digest == '-')
X adios (NULLCP, "missing argument to %s", argp[-2]);
X+ continue;
X+ case ISSUESW:
X+ if (!(cp = *argp++) || *cp == '-')
X+ adios (NULLCP, "missing argument to %s", argp[-2]);
X+ if ((issue = atoi (cp)) < 1)
X+ adios (NULLCP, "bad argument %s %s", argp[-2], cp);
X+ continue;
X+ case VOLUMSW:
X+ if (!(cp = *argp++) || *cp == '-')
X+ adios (NULLCP, "missing argument to %s", argp[-2]);
X+ if ((volume = atoi (cp)) < 1)
X+ adios (NULLCP, "bad argument %s %s", argp[-2], cp);
X+ continue;
X+
X case FORW2SW:
X forwall++; /* fall */
X case FORW1SW:
X***************
X*** 422,428 ****
X if (forwall) {
X if (digest) {
X printf ("%s", delim4);
X! (void) sprintf (buf, "End of %s Digest\n", digest);
X i = strlen (buf);
X for (cp = buf + i; i > 1; i--)
X *cp++ = '*';
X--- 452,462 ----
X if (forwall) {
X if (digest) {
X printf ("%s", delim4);
X! if (volume == 0) {
X! (void) sprintf (buf, "End of %s Digest\n", digest);
X! }
X! else
X! (void) sprintf (buf, "End of %s Digest [Volume %d Issue %d]\n", digest, volume, issue);
X i = strlen (buf);
X for (cp = buf + i; i > 1; i--)
X *cp++ = '*';
X***************
X*** 993,1005 ****
X dat[3] = sizeof buffer - 1;
X (void) fmt_compile (c1 -> c_nfs, &c1 -> c_fmt);
X
X! if (c1 -> c_flags & DATEFMT) {
X FINDCOMP (cptr, "text");
X if (cptr)
X cptr -> c_text = ap;
X
X (void) fmtscan (c1 -> c_fmt, buffer, sizeof buffer - 1, dat);
X! c2 -> c_text = concat (buffer, "\n", NULLCP);
X
X free (ap);
X return;
X--- 1027,1040 ----
X dat[3] = sizeof buffer - 1;
X (void) fmt_compile (c1 -> c_nfs, &c1 -> c_fmt);
X
X! if (!(c1 -> c_flags & ADDRFMT)) {
X FINDCOMP (cptr, "text");
X if (cptr)
X cptr -> c_text = ap;
X
X (void) fmtscan (c1 -> c_fmt, buffer, sizeof buffer - 1, dat);
X! /* Don't need to append a newline, dctime() already did */
X! c2 -> c_text = getcpy (buffer);
X
X free (ap);
X return;
X***************
X*** 1162,1168 ****
X break;
X }
X
X! if (c1 -> c_nfs && (c1 -> c_flags & (ADDRFMT | DATEFMT)))
X mcomp_format (c1, c2);
X
X if (c1 -> c_flags & CENTER) {
X--- 1197,1203 ----
X break;
X }
X
X! if (c1 -> c_nfs && (c1 -> c_flags & (ADDRFMT | DATEFMT | FORMAT)))
X mcomp_format (c1, c2);
X
X if (c1 -> c_flags & CENTER) {
X***************
X*** 1193,1198 ****
X--- 1228,1235 ----
X while (count--)
X putstr (" ");
X }
X+ else
X+ c1 -> c_flags |= HDROUTPUT; /* for BODYCOMP */
X }
X
X if (flag == TWOCOMP
X***************
X*** 1230,1249 ****
X putstr (oneline (c2 -> c_text, c1 -> c_flags));
X if (term == '\n')
X putstr ("\n");
X! while (cp = oneline (c2 -> c_text, c1 -> c_flags))
X! if (*cp) {
X! lm = count;
X! if (flag == BODYCOMP
X! && !(c1 -> c_flags & HDROUTPUT)
X! && !(c1 -> c_flags & NOCOMPONENT))
X! putstr (c1 -> c_text ? c1 -> c_text : c1 -> c_name);
X putstr (cp);
X! if (term == '\n')
X! putstr ("\n");
X! }
X! else
X! if (term == '\n')
X! putstr ("\n");
X }
X
X /* */
X--- 1267,1282 ----
X putstr (oneline (c2 -> c_text, c1 -> c_flags));
X if (term == '\n')
X putstr ("\n");
X! while (cp = oneline (c2 -> c_text, c1 -> c_flags)) {
X! lm = count;
X! if (flag == BODYCOMP
X! && !(c1 -> c_flags & NOCOMPONENT))
X! putstr (c1 -> c_text ? c1 -> c_text : c1 -> c_name);
X! if (*cp)
X putstr (cp);
X! if (term == '\n')
X! putstr ("\n");
X! }
X }
X
X /* */
X***************
X*** 1460,1466 ****
X
X /* */
X
X! #ifdef BSD42
X
X /* faceproc is two elements defining the image agent's location:
X Internet host
X--- 1493,1499 ----
X
X /* */
X
X! #if defined(BSD42) || defined(SOCKETS)
X
X /* faceproc is two elements defining the image agent's location:
X Internet host
X***************
X*** 1470,1480 ****
X #include <sys/socket.h>
X #include <netinet/in.h>
X #include <netdb.h>
X
X-
X- long inet_addr ();
X-
X-
X static int doface (c1)
X register struct mcomp *c1;
X {
X--- 1503,1510 ----
X #include <sys/socket.h>
X #include <netinet/in.h>
X #include <netdb.h>
X+ #include <arpa/inet.h>
X
X static int doface (c1)
X register struct mcomp *c1;
X {
X***************
X*** 1489,1495 ****
X static u_short portno;
X
X if (inited == OK) {
X! long iaddr;
X char *cp;
X char **ap = brkstring (cp = getcpy (faceproc), " ", "\n");
X struct hostent *hp;
X--- 1519,1525 ----
X static u_short portno;
X
X if (inited == OK) {
X! u_long iaddr;
X char *cp;
X char **ap = brkstring (cp = getcpy (faceproc), " ", "\n");
X struct hostent *hp;
X***************
X*** 1532,1538 ****
X return (result != NOTOK ? OK : NOTOK);
X }
X
X! #else
X
X static int doface (c1)
X register struct mcomp *c1;
X--- 1562,1568 ----
X return (result != NOTOK ? OK : NOTOK);
X }
X
X! #else not BSD42 and not SOCKETS
X
X static int doface (c1)
X register struct mcomp *c1;
X***************
X*** 1641,1647 ****
X
X return result;
X }
X! #endif
X
X /* */
X
X--- 1671,1677 ----
X
X return result;
X }
X! #endif not BSD42 and not SOCKETS
X
X /* */
X
X***************
X*** 1653,1659 ****
X char **argv;
X FP (*action) ();
X {
X! int (*istat) (), (*pstat) (), (*qstat) ();
X char *cp;
X struct mcomp *c1;
X
X--- 1683,1689 ----
X char **argv;
X FP (*action) ();
X {
X! TYPESIG (*istat) (), (*pstat) (), (*qstat) ();
X char *cp;
X struct mcomp *c1;
X
X*** ../mh-6.6.0/./uip/mshcmds.c Thu Oct 29 15:02:33 1987
X--- ./uip/mshcmds.c Thu Apr 5 16:03:45 1990
X***************
X*** 1,4 ****
X--- 1,7 ----
X /* mshcmds.c - command handlers in msh */
X+ #ifndef lint
X+ static char ident[] = "@(#)$Id: mshcmds.c,v 1.5 90/04/05 15:01:41 sources Exp $";
X+ #endif lint
X
X #include "../h/mh.h"
X #include "../h/dropsbr.h"
X***************
X*** 28,40 ****
X static FILE *mhlfp;
X
X void clear_screen ();
X! int eom_action ();
X! FP mhl_action ();
X
X
X /* SORTM */
X! int msgsort ();
X! struct tws *getws ();
X
X /* */
X
X--- 31,46 ----
X static FILE *mhlfp;
X
X void clear_screen ();
X! static int eom_action ();
X! static FP mhl_action ();
X
X
X+ static burst(), forw(), rmm(), show(), ask(), copy_message(), copy_digest();
X+ static int process();
X /* SORTM */
X! static int msgsort (), subsort();
X! static int getws ();
X! static char *sosmash ();
X
X /* */
X
X***************
X*** 2383,2393 ****
X static struct swit sortswit[] = {
X #define SODATE 0
X "datefield field", 0,
X! #define SOVERB 1
X "verbose", 0,
X! #define SONVERB 2
X "noverbose", 0,
X! #define SOHELP 3
X "help", 4,
X
X NULL, NULL
X--- 2389,2407 ----
X static struct swit sortswit[] = {
X #define SODATE 0
X "datefield field", 0,
X! #define SOSUBJ 1
X! "textfield field", 0,
X! #define SONSUBJ 2
X! "notextfield", 0,
X! #define SOLIMT 3
X! "limit days", 0,
X! #define SONLIMT 4
X! "nolimit", 0,
X! #define SOVERB 5
X "verbose", 0,
X! #define SONVERB 6
X "noverbose", 0,
X! #define SOHELP 7
X "help", 4,
X
X NULL, NULL
X***************
X*** 2402,2407 ****
X--- 2416,2422 ----
X msgnum;
X char *cp,
X *datesw = NULL,
X+ *subjsw = NULL,
X buf[BUFSIZ],
X *msgs[MAXARGS];
X struct tws tb,
X***************
X*** 2437,2442 ****
X--- 2452,2477 ----
X }
X continue;
X
X+ case SOSUBJ:
X+ if (subjsw) {
X+ advise (NULLCP, "only one text field at a time!");
X+ return;
X+ }
X+ if (!(subjsw = *args++) || *subjsw == '-') {
X+ advise (NULLCP, "missing argument to %s", args[-2]);
X+ return;
X+ }
X+ continue;
X+ case SONSUBJ:
X+ subjsw = (char *)0;
X+ continue;
X+
X+ case SOLIMT: /* too hard */
X+ if (!(cp = *args++) || *cp == '-') {
X+ advise (NULLCP, "missing argument to %s", args[-2]);
X+ return;
X+ }
X+ case SONLIMT:
X case SOVERB: /* not implemented */
X case SONVERB:
X continue;
X***************
X*** 2466,2477 ****
X Msgs[msgnum].m_scanl = NULL;
X }
X if (mp -> msgstats[msgnum] & SELECTED) {
X! if ((tw = getws (datesw, msgnum)) == NULL)
X! tw = msgnum != mp -> lowsel ? &Msgs[msgnum - 1].m_tb : &tb;
X }
X! else
X! tw = &tb;
X! twscopy (&Msgs[msgnum].m_tb, tw);
X Msgs[msgnum].m_stats = mp -> msgstats[msgnum];
X if (mp -> curmsg == msgnum)
X Msgs[msgnum].m_stats |= CUR;
X--- 2501,2512 ----
X Msgs[msgnum].m_scanl = NULL;
X }
X if (mp -> msgstats[msgnum] & SELECTED) {
X! if (getws (datesw, subjsw, msgnum, &Msgs[msgnum]))
X! twscopy (&Msgs[msgnum].m_tb,
X! msgnum != mp -> lowsel ? &Msgs[msgnum - 1].m_tb : &tb);
X }
X! else /* m_scaln is already NULL */
X! twscopy (&Msgs[msgnum].m_tb, &tb);
X Msgs[msgnum].m_stats = mp -> msgstats[msgnum];
X if (mp -> curmsg == msgnum)
X Msgs[msgnum].m_stats |= CUR;
X***************
X*** 2478,2486 ****
X }
X
X qsort ((char *) &Msgs[mp -> lowsel], mp -> hghsel - mp -> lowsel + 1,
X! sizeof (struct Msg), msgsort);
X
X for (msgnum = mp -> lowsel; msgnum <= mp -> hghsel; msgnum++) {
X mp -> msgstats[msgnum] = Msgs[msgnum].m_stats & ~CUR;
X if (Msgs[msgnum].m_stats & CUR)
X m_setcur (mp, msgnum);
X--- 2513,2526 ----
X }
X
X qsort ((char *) &Msgs[mp -> lowsel], mp -> hghsel - mp -> lowsel + 1,
X! sizeof (struct Msg),
X! subjsw ? subsort : msgsort);
X
X for (msgnum = mp -> lowsel; msgnum <= mp -> hghsel; msgnum++) {
X+ if (subjsw && Msgs[msgnum].m_scanl) {
X+ free (Msgs[msgnum].m_scanl); /* from subjsort */
X+ Msgs[msgnum].m_scanl = NULL;
X+ }
X mp -> msgstats[msgnum] = Msgs[msgnum].m_stats & ~CUR;
X if (Msgs[msgnum].m_stats & CUR)
X m_setcur (mp, msgnum);
X***************
X*** 2492,2510 ****
X
X /* */
X
X! static struct tws *getws (datesw, msgnum)
X! char *datesw;
X! int msgnum;
X {
X! int state;
X char *bp,
X buf[BUFSIZ],
X name[NAMESZ];
X! struct tws *tw;
X register FILE *zp;
X
X zp = msh_ready (msgnum, 0);
X! for (state = FLD;;)
X switch (state = m_getfld (state, name, buf, sizeof buf, zp)) {
X case FLD:
X case FLDEOF:
X--- 2532,2558 ----
X
X /* */
X
X! /*
X! * getws - parse message, and get date and subject if needed. We'll use
X! * the msgp->m_tb tws struct for the date, and overload the msgp->m_scanl
X! * field with our subject string.
X! */
X! static int getws (datesw, subjsw, msgnum, msgp)
X! char *datesw,
X! *subjsw;
X! int msgnum;
X! struct Msg *msgp;
X {
X! int state,
X! gotdate = 0;
X char *bp,
X buf[BUFSIZ],
X name[NAMESZ];
X! struct tws *tw = (struct tws *)0;
X register FILE *zp;
X
X zp = msh_ready (msgnum, 0);
X! for (state = FLD;;) {
X switch (state = m_getfld (state, name, buf, sizeof buf, zp)) {
X case FLD:
X case FLDEOF:
X***************
X*** 2519,2548 ****
X admonish (NULLCP,
X "unable to parse %s field in message %d",
X datesw, msgnum);
X free (bp);
X! return tw;
X }
X! while (state == FLDPLUS)
X! state = m_getfld (state, name, buf, sizeof buf, zp);
X! if (state != FLDEOF)
X! continue;
X
X case BODY:
X case BODYEOF:
X case FILEEOF:
X! admonish (NULLCP, "no %s field in message %d", datesw, msgnum);
X! return NULL;
X
X case LENERR:
X case FMTERR:
X admonish (NULLCP, "format error in message %d", msgnum);
X! return NULL;
X
X default:
X adios (NULLCP, "internal error -- you lose");
X }
X }
X
X
X static int msgsort (a, b)
X struct Msg *a,
X--- 2567,2623 ----
X admonish (NULLCP,
X "unable to parse %s field in message %d",
X datesw, msgnum);
X+ else
X+ twscopy (&(msgp->m_tb), tw);
X free (bp);
X! if (!subjsw) /* not using this, or already done */
X! break; /* all done! */
X! gotdate++;
X }
X! else if (subjsw && uleq(name, subjsw)) {
X! bp = getcpy (buf);
X! while (state == FLDPLUS) {
X! state = m_getfld (state, name, buf, sizeof buf, zp);
X! bp = add (buf, bp);
X! }
X! msgp->m_scanl = sosmash(subjsw, bp);
X! if (gotdate)
X! break; /* date done so we're done */
X! else
X! subjsw = (char *)0;/* subject done, need date */
X! } else {
X! while (state == FLDPLUS) /* flush this one */
X! state = m_getfld (state, name, buf, sizeof buf, zp);
X! }
X! continue;
X
X case BODY:
X case BODYEOF:
X case FILEEOF:
X! break;
X
X case LENERR:
X case FMTERR:
X admonish (NULLCP, "format error in message %d", msgnum);
X! if (msgp->m_scanl) { /* this might need free'd */
X! free (msgp->m_scanl); /* probably can't use subj anyway */
X! msgp->m_scanl = NULL;
X! }
X! return NOTOK;
X
X default:
X adios (NULLCP, "internal error -- you lose");
X }
X+ break;
X+ }
X+ if (tw)
X+ return OK; /* not an error if subj not found */
X+
X+ admonish (NULLCP, "no %s field in message %d", datesw, msgnum);
X+ return NOTOK; /* NOTOK means use some other date */
X }
X
X+ /* sort routines */
X
X static int msgsort (a, b)
X struct Msg *a,
X***************
X*** 2549,2554 ****
X--- 2624,2680 ----
X *b;
X {
X return twsort (&a -> m_tb, &b -> m_tb);
X+ }
X+
X+ static int subsort (a, b)
X+ struct Msg *a,
X+ *b;
X+ {
X+ register int i;
X+
X+ if (a->m_scanl && b->m_scanl)
X+ if (i = strcmp (a->m_scanl, b->m_scanl))
X+ return (i);
X+
X+ return twsort (&a -> m_tb, &b -> m_tb);
X+ }
X+
X+ /*
X+ * try to make the subject "canonical": delete leading "re:", everything
X+ * but letters & smash letters to lower case.
X+ */
X+ static char *
X+ sosmash (subj, s)
X+ char *subj;
X+ register char *s;
X+ {
X+ register char *cp,
X+ *dp,
X+ c;
X+ if (s) {
X+ cp = s;
X+ dp = s; /* dst pointer */
X+ if (uleq (subj, "subject"))
X+ while (c = *cp++) {
X+ if (! isspace(c)) {
X+ if ((c == 'R' || c == 'r') &&
X+ (cp[0] == 'e' || cp[0] == 'E') && cp[1] == ':')
X+ cp += 2;
X+ else {
X+ if (isalnum(c))
X+ *dp++ = isupper(c) ? tolower(c) : c;
X+ break;
X+ }
X+ }
X+ }
X+ while (c = *cp++) {
X+ if (isalnum(c))
X+ *dp++ = isupper(c) ? tolower(c) : c;
X+
X+ }
X+ *dp = '\0';
X+ }
X+ return s;
X }
X
X /* */
X*** ../mh-6.6.0/./uip/forw.c Thu Oct 29 15:02:23 1987
X--- ./uip/forw.c Thu Apr 5 16:03:37 1990
X***************
X*** 1,4 ****
X--- 1,7 ----
X /* forw.c - forward messages */
X+ #ifndef lint
X+ static char ident[] = "@(#)$Id: forw.c,v 1.6 90/04/05 14:59:50 sources Exp $";
X+ #endif lint
X
X #include "../h/mh.h"
X #include "../h/formatsbr.h"
X***************
X*** 11,16 ****
X--- 14,20 ----
X #define IFMT "digest-issue-%s"
X #define VFMT "digest-volume-%s"
X
X+ static mhl_draft(), copy_draft(), build_form();
X /* */
X
X static struct swit switches[] = {
X***************
X*** 65,71 ****
X "file file", -4, /* interface from msh */
X
X #define DASHSW 20
X! "dashmunging", -4,
X #define NDASHSW 21
X "nodashmunging", -6,
X
X--- 69,75 ----
X "file file", -4, /* interface from msh */
X
X #define DASHSW 20
X! "dashmunging", -4, /* interface to mhl */
X #define NDASHSW 21
X "nodashmunging", -6,
X
X***************
X*** 421,429 ****
X }
X
X if (filter)
X! mhl_draft (out, digest, drft, filter, dashflg);
X else
X! copy_draft (out, digest, drft);
X (void) close (out);
X
X if (digest) {
X--- 425,433 ----
X }
X
X if (filter)
X! mhl_draft (out, digest, volume, issue, drft, filter, dashflg);
X else
X! copy_draft (out, digest, drft, volume, issue);
X (void) close (out);
X
X if (digest) {
X***************
X*** 451,458 ****
X
X /* */
X
X! static mhl_draft (out, digest, file, filter, dashflg)
X int out,
X dashflg;
X register char *digest,
X *file,
X--- 455,464 ----
X
X /* */
X
X! static mhl_draft (out, digest, volume, issue, file, filter, dashflg)
X int out,
X+ volume,
X+ issue,
X dashflg;
X register char *digest,
X *file,
X***************
X*** 463,469 ****
X msgnum,
X pd[2];
X char *vec[MAXARGS];
X!
X if (pipe (pd) == NOTOK)
X adios ("pipe", "unable to create");
X
X--- 469,477 ----
X msgnum,
X pd[2];
X char *vec[MAXARGS];
X! char buf1[BUFSIZ];
X! char buf2[BUFSIZ];
X!
X if (pipe (pd) == NOTOK)
X adios ("pipe", "unable to create");
X
X***************
X*** 487,492 ****
X--- 495,504 ----
X if (digest) {
X vec[i++] = "-digest";
X vec[i++] = digest;
X+ vec[i++] = "-issue";
X+ sprintf(buf1, "%d", issue); vec[i++] = buf1;
X+ vec[i++] = "-volume";
X+ sprintf(buf2, "%d", volume); vec[i++] = buf2;
X }
X vec[i++] = dashflg ? "-dashmunging" : "-nodashmunging";
X if (mp -> numsel >= MAXARGS - i)
X***************
X*** 513,520 ****
X
X /* */
X
X! static copy_draft (out, digest, file)
X! int out;
X register char *digest,
X *file;
X {
X--- 525,534 ----
X
X /* */
X
X! static copy_draft (out, digest, file, volume, issue)
X! int out,
X! volume,
X! issue;
X register char *digest,
X *file;
X {
X***************
X*** 561,567 ****
X (void) write (out, buffer, strlen (buffer));
X
X if (digest) {
X! (void) sprintf (buffer, "End of %s Digest\n", digest);
X i = strlen (buffer);
X for (bp = buffer + i; i > 1; i--)
X *bp++ = '*';
X--- 575,581 ----
X (void) write (out, buffer, strlen (buffer));
X
X if (digest) {
X! (void) sprintf (buffer, "End of %s Digest [Volume %d Issue %d]\n", digest, volume, issue);
X i = strlen (buffer);
X for (bp = buffer + i; i > 1; i--)
X *bp++ = '*';
X*** ../mh-6.6.0/./uip/aliasbr.c Thu Oct 29 15:02:06 1987
X--- ./uip/aliasbr.c Thu Apr 5 16:03:33 1990
X***************
X*** 1,4 ****
X--- 1,7 ----
X /* aliasbr.c - new aliasing mechanism */
X+ #ifndef lint
X+ static char ident[] = "@(#)$Id: aliasbr.c,v 1.7 90/04/05 14:59:03 sources Exp $";
X+ #endif lint
X
X #include "../h/mh.h"
X #include "../h/aliasbr.h"
X***************
X*** 7,13 ****
X #include <pwd.h>
X #include <stdio.h>
X
X-
X static int akvis;
X static char *akerrst;
X
X--- 10,15 ----
X***************
X*** 17,26 ****
X struct home *homehead = NULL;
X struct home *hometail = NULL;
X
X! char *scanp (), *getp (), *seekp (), *akval (), *getalias ();
X! struct aka *akalloc ();
X! struct home *hmalloc ();
X
X
X struct passwd *getpwent ();
X struct group *getgrnam (), *getgrgid ();
X--- 19,30 ----
X struct home *homehead = NULL;
X struct home *hometail = NULL;
X
X! static char *scanp (), *getp (), *seekp (), *akval (), *getalias ();
X! static struct aka *akalloc ();
X! static struct home *hmalloc ();
X
X+ static add_aka();
X+ static int aleq(), addfile(), addgroup(), addmember(), addall();
X
X struct passwd *getpwent ();
X struct group *getgrnam (), *getgrgid ();
X***************
X*** 80,85 ****
X--- 84,92 ----
X register struct aka *ak;
X register char *s;
X {
X+ if (!s)
X+ return s; /* XXX */
X+
X for (; ak; ak = ak -> ak_next)
X if (aleq (s, ak -> ak_name))
X return akresult (ak);
X***************
X*** 137,143 ****
X (void) fclose (fp);
X return AK_ERROR;
X }
X! if ((i = alias (cp) != AK_OK)) {
X (void) fclose (fp);
X return i;
X }
X--- 144,150 ----
X (void) fclose (fp);
X return AK_ERROR;
X }
X! if ((i = alias (cp)) != AK_OK) {
X (void) fclose (fp);
X return i;
X }
X***************
X*** 144,149 ****
X--- 151,157 ----
X
X case ':': /* comment */
X case ';':
X+ case '#':
X case NULL:
X continue;
X }
X***************
X*** 338,352 ****
X--- 346,374 ----
X return NULL;
X }
X
X+ #ifndef DBM
X if (homehead == NULL)
X init_pw ();
X+ #endif /* DBM */
X
X while (gp = *gr -> gr_mem++)
X+ #ifdef DBM
X+ {
X+ struct passwd *pw;
X+ #endif /* DBM */
X for (hm = homehead; hm; hm = hm -> h_next)
X if (!strcmp (hm -> h_name, gp)) {
X add_aka (ak, hm -> h_name);
X break;
X }
X+ #ifdef DBM
X+ if (pw = getpwnam(gp))
X+ {
X+ hmalloc(pw);
X+ add_aka (ak, gp);
X+ }
X+ }
X+ #endif /* DBM */
X
X return 1;
X }
X***************
X*** 372,378 ****
X--- 394,402 ----
X return NULL;
X }
X
X+ #ifndef DBM
X if (homehead == NULL)
X+ #endif /* DBM */
X init_pw ();
X
X for (hm = homehead; hm; hm = hm -> h_next)
X***************
X*** 390,398 ****
X--- 414,426 ----
X int noshell = NoShell == NULLCP || *NoShell == NULL;
X register struct home *hm;
X
X+ #ifndef DBM
X if (homehead == NULL)
X+ #endif /* DBM */
X init_pw ();
X+ #ifndef DBM
X if (Everyone < 0)
X+ #endif /* DBM */
X Everyone = EVERYONE;
X
X for (hm = homehead; hm; hm = hm -> h_next)
X***************
X*** 464,469 ****
X--- 492,508 ----
X
X init_pw () {
X register struct passwd *pw;
X+ #ifdef DBM
X+ static int init;
X+
X+ if (!init)
X+ {
X+ /* if the list has yet to be initialized */
X+ /* zap the list, and rebuild from scratch */
X+ homehead=NULL;
X+ hometail=NULL;
X+ init++;
X+ #endif /* DBM */
X
X (void) setpwent ();
X
X***************
X*** 472,477 ****
X--- 511,519 ----
X break;
X
X (void) endpwent ();
X+ #ifdef DBM
X+ }
X+ #endif /* DBM */
X }
X
X /* */
X***************
X*** 531,543 ****
X--- 573,603 ----
X register char *name;
X {
X register struct home *hp;
X+ #ifdef DBM
X+ struct passwd *pw;
X+ char lname[32];
X+ char *c,*c1;
X+ #else /* DBM */
X
X if (homehead == NULL)
X init_pw ();
X+ #endif /* DBM */
X
X for (hp = homehead; hp; hp = hp -> h_next)
X if (uleq (name, hp -> h_name))
X return hp;
X+
X+ #ifdef DBM /* The only place where there might be problems */
X+ /* This assumes that ALL usernames are kept in lowercase */
X+ for (c = name,c1 = lname; *c; c++, c1++)
X+ if (isupper(*c))
X+ *c1 = tolower(*c);
X+ else
X+ *c1 = *c;
X+ *c1 = NULL;
X+ if (pw = getpwnam(lname))
X+ return(hmalloc(pw));
X+ #endif /* DBM */
X
X return NULL;
X }
X*** ../mh-6.6.0/./uip/dropsbr.c Thu Oct 29 15:02:21 1987
X--- ./uip/dropsbr.c Thu Apr 5 16:03:42 1990
X***************
X*** 1,4 ****
X--- 1,7 ----
X /* dropsbr.c - write to a mailbox */
X+ #ifndef lint
X+ static char ident[] = "@(#)$Id: dropsbr.c,v 1.11 90/04/05 15:01:09 sources Exp $";
X+ #endif lint
X
X #include <stdio.h>
X #ifndef MMDFONLY
X***************
X*** 13,18 ****
X--- 16,26 ----
X #include <errno.h>
X #include <sys/types.h>
X #include <sys/stat.h>
X+ #if (defined(BSD42) || defined(SOCKETS)) && defined(NTOHLSWAP)
X+ #include <netinet/in.h>
X+ #else
X+ #define ntohl(n) (n)
X+ #endif
X
X
X #define MMDF 1
X***************
X*** 22,27 ****
X--- 30,36 ----
X
X static int mbx_style = MMDF;
X
X+ static int mbx_create(), mbx_chk(), map_open();
X
X extern int errno;
X
X***************
X*** 483,489 ****
X struct drop **drops;
X int noisy;
X {
X! register int i,
X md,
X msgp;
X register char *cp;
X--- 492,498 ----
X struct drop **drops;
X int noisy;
X {
X! register int i, j,
X md,
X msgp;
X register char *cp;
X***************
X*** 512,519 ****
X i = 0;
X free ((char *) dp);
X }
X! else
X *drops = dp;
X
X (void) close (md);
X
X--- 521,539 ----
X i = 0;
X free ((char *) dp);
X }
X! else {
X! #ifdef NTOHLSWAP
X! register struct drop *tdp;
X! for (j = 0, tdp = dp; j < i / sizeof(*dp); j++, tdp++) {
X! tdp->d_id = ntohl(tdp->d_id);
X! tdp->d_size = ntohl(tdp->d_size);
X! tdp->d_start = ntohl(tdp->d_start);
X! tdp->d_stop = ntohl(tdp->d_stop);
X! tdp++;
X! }
X! #endif
X *drops = dp;
X+ }
X
X (void) close (md);
X
X***************
X*** 651,669 ****
X long pos;
X {
X long count;
X! struct drop d;
X register struct drop *dl;
X
X! if (read (fd, (char *) dp, sizeof *dp) != sizeof *dp) {
X #ifdef notdef
X admonish (NULLCP, "%s: missing or partial index", file);
X #endif notdef
X return NOTOK;
X }
X
X if (dp -> d_size != DRVRSN) {
X if (noisy)
X! admonish (NULLCP, "%s: version mismatch", file);
X return NOTOK;
X }
X
X--- 671,698 ----
X long pos;
X {
X long count;
X! struct drop d, tmpd;
X register struct drop *dl;
X
X! if (read (fd, (char *) &tmpd, sizeof *dp) != sizeof *dp) {
X #ifdef notdef
X admonish (NULLCP, "%s: missing or partial index", file);
X #endif notdef
X return NOTOK;
X }
X+ #ifndef NTOHLSWAP
X+ *dp = tmpd; /* if ntohl(n)=(n), can use struct assign */
X+ #else
X+ dp->d_id = ntohl(tmpd.d_id);
X+ dp->d_size = ntohl(tmpd.d_size);
X+ dp->d_start = ntohl(tmpd.d_start);
X+ dp->d_stop = ntohl(tmpd.d_stop);
X+ #endif
X
X if (dp -> d_size != DRVRSN) {
X if (noisy)
X! admonish (NULLCP, "%s: version mismatch (%d != %d)", file,
X! dp->d_size, DRVRSN);
X return NOTOK;
X }
X
X***************
X*** 685,692 ****
X count = (long) strlen (mmdlm2);
X (void) lseek (fd, (long) (dp -> d_id * sizeof *dp), 0);
X if (read (fd, (char *) dl, sizeof *dl) != sizeof *dl
X! || (dl -> d_stop != dp -> d_stop
X! && dl -> d_stop + count != dp -> d_stop)) {
X if (noisy)
X admonish (NULLCP, "%s: corrupt index(2)", file);
X return NOTOK;
X--- 714,721 ----
X count = (long) strlen (mmdlm2);
X (void) lseek (fd, (long) (dp -> d_id * sizeof *dp), 0);
X if (read (fd, (char *) dl, sizeof *dl) != sizeof *dl
X! || (ntohl(dl -> d_stop) != dp -> d_stop
X! && ntohl(dl -> d_stop) + count != dp -> d_stop)) {
X if (noisy)
X admonish (NULLCP, "%s: corrupt index(2)", file);
X return NOTOK;
+ END-OF-FILE MH.6.6.9
chmod 'u=rw,g=r,o=r' 'MH.6.6.9'
echo ' -rw-r--r-- 1 mh 49409 Apr 13 13:53 MH.6.6.9 (as sent)'
echo -n ' '
/bin/ls -l MH.6.6.9
exit 0
More information about the Comp.sources.bugs
mailing list