Patches to MH 6.7.2 for IBM AIX 3.2 Bill Wohler 1. History: These patches were originally posted by Steven Lebowitz and I made some modifications for 6.7.1. Ed Anselmo and I modified them to work on MH 6.7.2 on AIX 3.2. AIX support should appear in MH 6.7.3, which is planned to be released by the end of '92. 2. To apply this patch: cd to the top of the source tree and do: patch -p1 -s < aix.mh-6.7.2 Patch will work silently unless an error occurs. You will likely get the following warning messages, which can be ignored: mkdir: cannot create config. config: File exists mkdir: cannot create sbr. sbr: File exists If you want to watch patch do its thing, leave out the "-s" argument to patch. Finally, to rebuild after applying this patch, do: % cd conf % make % ./mhconfig MH % cd .. % make >& Makelog % make inst-all 3. When installing new MH patches, back out these patches first (patch -p1 -R -s < aix.mh-6.7.2). 4. my MH file: bin /usr/local/bin/mh ldoptions -s manuals local mts sendmail/smtp options ATHENA BIND DBM ISI MHRC options TYPESIG='void' SYS5 SYS5DIR SOCKETS options MHE curses -lcurses sprintf int 5. fix permissions. #! /bin/sh # Run this script as root after installation on AIX systems. # Otherwise slocal and inc will *not* work. chgrp mail /usr/local/lib/mh/slocal /usr/local/bin/mh/inc chmod g+s /usr/local/lib/mh/slocal /usr/local/bin/mh/inc 6. Please contact Bill Wohler if you have any questions regarding these patches. *** mh-6.7/conf/mhconfig.c Mon Jan 27 12:34:35 1992 --- mh-6.7.new/conf/mhconfig.c Thu Aug 6 15:18:19 1992 *************** *** 570,576 **** } break; } ! if ((config = *vec++) == NULL || *vec != NULL) adios (NULLCP, "usage: %s file", myname); if ((fp = fopen (config, "r")) == NULL) --- 570,576 ---- } break; } ! if ((config = *vec++) == NULL && *vec != NULL) adios (NULLCP, "usage: %s file", myname); if ((fp = fopen (config, "r")) == NULL) *** mh-6.7/conf/config/mts.c Thu Feb 14 18:18:22 1991 --- mh-6.7.new/conf/config/mts.c Fri Aug 7 11:02:42 1992 *************** *** 43,49 **** --- 43,51 ---- #define rindex strrchr #endif SYS5 + #ifndef _AIX char *index (), *malloc (), *mktemp (), *rindex (), *strcpy (); + #endif struct passwd *getpwuid (); *************** *** 292,298 **** --- 294,304 ---- grot ('t', '\t'); #undef grot + #ifdef _AIX + case '\0': s--; + #else case NULL: s--; + #endif case QUOTE: *bp = QUOTE; break; *** mh-6.7/conf/config/mtstailor Thu Jun 15 16:10:12 1989 --- mh-6.7.new/conf/config/mtstailor Mon Jan 28 14:45:47 1991 *************** *** 1,4 **** ! mmdfldir: @(MHDROPATH) ! mmdflfil: @(MHDROPFIL) hostable: @(MHETCPATH)/hosts ! servers: localhost \01localnet --- 1,12 ---- ! mmdfldir: /usr/mail ! mmdflfil: ! uucpldir: /usr/mail ! uucplfil: ! mmdelim1: \001\001\001\001\n ! mmdelim2: \001\001\001\001\n ! mmailid: 0 ! umincproc: ! lockldir: ! hostable: @(MHETCPATH)/hosts ! sendmail: /usr/local/lib/mail/local_sendmail *** mh-6.7/config/version.sh Thu Jan 30 17:20:46 1992 --- mh-6.7.new/config/version.sh Fri Aug 7 11:09:50 1992 *************** *** 38,63 **** rm -f version.c ! cat version ${Patch} |\ ! awk -F. ' ! BEGIN { split ("'"${1}"'", ver, ".");\ ! major = ver[1]; minor = ver[2]; patch = ver[3]} \ ! NR == 1 { local = $(NF) } ;\ ! NR == 2 { patch = $(NF) } ;\ ! END { local++;\ ! if (patch > 0) {\ ! printf "char *version = \"@(#)MH %s.%s.%s #%d[UCI] ", \ ! major, minor, patch, local > "version.c"; \ ! printf ".ds MH %s.%s.%s #%d[UCI]\n", \ ! major, minor, patch, local > "../doc/version.rf"; \ ! printf "MH %s.%s.%s #%d[UCI]\n", major, minor, patch, local ;\ ! } else {\ ! printf "char *version = \"@(#)MH %s.%s #%d[UCI] ", \ ! major, minor, local > "version.c"; \ ! printf ".ds MH %s.%s #%d[UCI]\n", \ ! major, minor, local > "../doc/version.rf"; \ ! printf "MH %s.%s #%d[UCI]\n", major, minor, local ;\ ! }\ ! printf "%s.%s.%s.%d\n", major, minor, patch, local > "_version";\ ! }' && mv _version version echo '('$LOCAL') of '`date`'";' >> version.c --- 38,42 ---- rm -f version.c ! (echo $1; cat version ${Patch})|awk -F. -f version.awk && mv _version version echo '('$LOCAL') of '`date`'";' >> version.c *** /dev/null Sat Sep 12 15:01:35 1992 --- mh-6.7.new/config/version.awk Sat Sep 12 16:50:50 1992 *************** *** 0 **** --- 1,20 ---- + NR == 1 { major = $1; minor = $2; patch = $3 } + NR == 2 { local = $(NF) } + NR == 3 { patch = $(NF) } + END { + local++; + if (patch > 0) { + printf "char *version = \"MH %s.%s.%s #%d[UCI] ", \ + major, minor, patch, local > "version.c"; + printf ".ds MH %s.%s.%s #%d[UCI]\n", \ + major, minor, patch, local > "../doc/version.rf"; + printf "MH %s.%s.%s #%d[UCI]\n", major, minor, patch, local; + } else { + printf "char *version = \"MH %s.%s #%d[UCI] ", \ + major, minor, local > "version.c"; + printf ".ds MH %s.%s #%d[UCI]\n", \ + major, minor, local > "../doc/version.rf"; + printf "MH %s.%s #%d[UCI]\n", major, minor, local; + } + printf "%s.%s.%s.%d\n", major, minor, patch, local > "_version"; + } *** mh-6.7/h/local.h Thu Oct 29 17:56:18 1987 --- mh-6.7.new/h/local.h Thu Aug 6 15:35:06 1992 *************** *** 6,19 **** #include #endif BSD42 ! #ifndef BSD42 #ifndef NDIR #include #else NDIR #include #endif NDIR ! #else BSD42 #include ! #endif BSD42 #include --- 6,23 ---- #include #endif BSD42 ! #ifndef _AUX_SOURCE ! #if !defined(BSD42) && !defined(_AIX) #ifndef NDIR #include #else NDIR #include #endif NDIR ! #else BSD42 || _AIX #include ! #endif BSD42 || _AIX ! #else _AUX_SOURCE ! #include ! #endif _AUX_SOURCE #include *** mh-6.7/h/mh.h Thu Jan 23 19:03:59 1992 --- mh-6.7.new/h/mh.h Thu Aug 6 15:36:26 1992 *************** *** 344,350 **** /* miscellaneous */ ! #if !defined(BSD42) && !defined(hpux) && !defined(ncr) #define rename(f1,f2) (link (f1, f2) != NOTOK ? unlink (f1) : NOTOK) #endif not BSD42 --- 344,350 ---- /* miscellaneous */ ! #if !defined(BSD42) && !defined(hpux) && !defined(ncr) && !defined(_AIX) #define rename(f1,f2) (link (f1, f2) != NOTOK ? unlink (f1) : NOTOK) #endif not BSD42 *** mh-6.7/h/strings.h Thu Jan 23 18:16:49 1992 --- mh-6.7.new/h/strings.h Fri Aug 7 10:06:28 1992 *************** *** 5,17 **** --- 5,20 ---- #define _STRINGS #ifdef SYS5 + #ifndef _AIX #define index strchr #define rindex strrchr + #endif !_AIX #endif SYS5 char *index (); char *mktemp (); char *rindex (); + #ifndef _AIX #ifndef SPRINTFTYPE #ifndef ncr /* NCR compiler complains about re-declaration */ char *sprintf (); /* I guess this is the new standard */ *************** *** 29,34 **** --- 32,38 ---- char *getenv (); char *calloc (), *malloc (), *realloc (); + #endif !_AIX #ifdef SYS5 #include *** /dev/null Sat Sep 12 15:01:35 1992 --- mh-6.7.new/sbr/version.awk Sat Sep 12 16:50:51 1992 *************** *** 0 **** --- 1,7 ---- + NR == 1 { major = $1; minor = $2; patch = $3 } + NR == 2 { compile = $(NF) } + NR == 3 { if (major != $1) {major = $1; minor = 0}; + if (minor != $2) {minor = $2; compile = 0}} + END { compile++; + printf "version: libmh %d.%d.%d\n", major, minor, compile; + printf "%d.%d.%d\n", major, minor, compile > "_version";} *** mh-6.7/sbr/formatsbr.c Fri Jan 24 13:09:34 1992 --- mh-6.7.new/sbr/formatsbr.c Fri Aug 7 10:09:44 1992 *************** *** 96,103 **** case '\n': break; case NULL: ! cp--; /* fall */ default: *dp++ = *cp; break; --- 96,107 ---- case '\n': break; + #ifdef _AIX + case '\0': + #else case NULL: ! #endif ! cp--; /* fall */ default: *dp++ = *cp; break; *** mh-6.7/sbr/makedir.c Thu Jan 23 18:12:50 1992 --- mh-6.7.new/sbr/makedir.c Thu Aug 6 16:17:02 1992 *************** *** 22,27 **** --- 22,32 ---- #ifdef SYS5DIR #include #include + #ifdef _AIX + #include + #include + #include + #endif #endif SYS5DIR extern int errno; *** mh-6.7/sbr/path.c Tue Feb 6 16:09:03 1990 --- mh-6.7.new/sbr/path.c Fri Aug 7 11:35:48 1992 *************** *** 107,113 **** --- 107,117 ---- for (cp = f; *cp;) if (*cp == '/') { switch (*++cp) { + #ifdef _AIX + case '\0': + #else case NULL: + #endif if (--cp > f) *cp = NULL; break; *** mh-6.7/support/pop/popd.c Mon Apr 9 12:45:16 1990 --- mh-6.7.new/support/pop/popd.c Fri Aug 7 14:13:53 1992 *************** *** 27,32 **** --- 27,35 ---- #ifdef SIGTSTP #include #include + #ifdef _AIX + #include + #endif #endif SIGTSTP #include #include *** mh-6.7/support/pop/popsbr.c Mon Apr 9 12:45:18 1990 --- mh-6.7.new/support/pop/popsbr.c Mon Jan 28 19:01:07 1991 *************** *** 73,82 **** --- 73,90 ---- case OK: if (poprint) fprintf (stderr, "<--- %s\n", response); + #ifndef _AUX_SOURCE if (*response == '+' && command ("USER %s", user) != NOTOK && command ("%s %s", rpop ? "RPOP" : (pophack++, "PASS"), pass) != NOTOK) + #else _AUX_SOURCE + if (*response == '+' + && command ("USER %s", user) != NOTOK + && command ("%s %s", rpop ? "RPOP" : + (pophack++ - pophack - atoi("1") + "PASS"), + pass) != NOTOK) + #endif _AUX_SOURCE return OK; if (*response != '+') { (void) strcpy (buffer, response); *** mh-6.7/uip/ali.c Thu Apr 5 19:03:56 1990 --- mh-6.7.new/uip/ali.c Fri Aug 7 11:47:09 1992 *************** *** 191,197 **** --- 191,201 ---- pos += 2; } + #ifdef _AIX + case '\0': + #else case NULL: + #endif break; default: *** mh-6.7/uip/aliasbr.c Thu Apr 5 19:03:33 1990 --- mh-6.7.new/uip/aliasbr.c Fri Aug 7 10:12:42 1992 *************** *** 152,158 **** case ':': /* comment */ case ';': case '#': ! case NULL: continue; } --- 152,162 ---- case ':': /* comment */ case ';': case '#': ! #ifdef _AIX ! case '\0': ! #else ! case NULL: ! #endif continue; } *************** *** 180,186 **** } switch (*(pp = scanp (ap))) { ! case NULL: /* EOL */ (void) fclose (fp); return AK_ERROR; --- 184,194 ---- } switch (*(pp = scanp (ap))) { ! #ifdef _AIX ! case '\0': /* EOL */ ! #else ! case NULL: /* EOL */ ! #endif (void) fclose (fp); return AK_ERROR; *** mh-6.7/uip/bbc.c Thu Apr 5 19:02:56 1990 --- mh-6.7.new/uip/bbc.c Fri Aug 7 14:25:01 1992 *************** *** 21,26 **** --- 21,29 ---- #include #ifdef SIGTSTP #include + #ifdef _AIX + #include + #endif #include #include #endif SIGTSTP *** mh-6.7/uip/msh.c Thu Apr 5 19:02:57 1990 --- mh-6.7.new/uip/msh.c Fri Aug 7 10:55:57 1992 *************** *** 1562,1568 **** --- 1562,1572 ---- case '"': for (;;) { switch (c = *cp++) { + #ifdef _AIX + case '\0': + #else case NULL: + #endif padvise (NULLCP, "unmatched \""); return NOTOK; case '"': *** mh-6.7/uip/mshcmds.c Thu Jan 23 17:58:19 1992 --- mh-6.7.new/uip/mshcmds.c Fri Aug 7 14:09:48 1992 *************** *** 39,45 **** static int process(); /* SORTM */ static int msgsort (), subsort(); ! static int getws (); static char *sosmash (); /* */ --- 39,45 ---- static int process(); /* SORTM */ static int msgsort (), subsort(); ! static int local_getws (); static char *sosmash (); /* */ *************** *** 2502,2508 **** Msgs[msgnum].m_scanl = NULL; } if (mp -> msgstats[msgnum] & SELECTED) { ! if (getws (datesw, subjsw, msgnum, &Msgs[msgnum])) twscopy (&Msgs[msgnum].m_tb, msgnum != mp -> lowsel ? &Msgs[msgnum - 1].m_tb : &tb); } --- 2502,2508 ---- Msgs[msgnum].m_scanl = NULL; } if (mp -> msgstats[msgnum] & SELECTED) { ! if (local_getws (datesw, subjsw, msgnum, &Msgs[msgnum])) twscopy (&Msgs[msgnum].m_tb, msgnum != mp -> lowsel ? &Msgs[msgnum - 1].m_tb : &tb); } *************** *** 2534,2544 **** /* */ /* ! * getws - parse message, and get date and subject if needed. We'll use * the msgp->m_tb tws struct for the date, and overload the msgp->m_scanl * field with our subject string. */ ! static int getws (datesw, subjsw, msgnum, msgp) char *datesw, *subjsw; int msgnum; --- 2534,2544 ---- /* */ /* ! * local_getws - parse message, and get date and subject if needed. We'll use * the msgp->m_tb tws struct for the date, and overload the msgp->m_scanl * field with our subject string. */ ! static int local_getws (datesw, subjsw, msgnum, msgp) char *datesw, *subjsw; int msgnum; *** mh-6.7/uip/popsbr.c Mon Apr 9 12:47:26 1990 --- mh-6.7.new/uip/popsbr.c Mon Jan 28 18:47:26 1991 *************** *** 75,82 **** --- 75,88 ---- fprintf (stderr, "<--- %s\n", response); if (*response == '+' && command ("USER %s", user) != NOTOK + #ifndef _AUX_SOURCE && command ("%s %s", rpop ? "RPOP" : (pophack++, "PASS"), pass) != NOTOK) + #else _AUX_SOURCE + && command ("%s %s", rpop ? "RPOP" : + (pophack++ - pophack - 1 + "PASS"), + pass) != NOTOK) + #endif _AUX_SOURCE return OK; if (*response != '+') { (void) strcpy (buffer, response); *** mh-6.7/uip/sortm.c Wed Dec 19 13:02:32 1990 --- mh-6.7.new/uip/sortm.c Fri Aug 7 14:10:40 1992 *************** *** 52,58 **** int submajor = 0; /* if true, sort on subject-major */ int verbose; ! static getws(); static int dsort(), read_hdrs (), subsort(), txtsort(); static void rename_chain(), rename_msgs(); --- 52,58 ---- int submajor = 0; /* if true, sort on subject-major */ int verbose; ! static local_getws(); static int dsort(), read_hdrs (), subsort(), txtsort(); static void rename_chain(), rename_msgs(); *************** *** 295,301 **** s = smsgs; for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (mp->msgstats[msgnum] & SELECTED) { ! if (getws (datesw, msgnum, s)) { s->s_msg = msgnum; s++; } --- 295,301 ---- s = smsgs; for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (mp->msgstats[msgnum] & SELECTED) { ! if (local_getws (datesw, msgnum, s)) { s->s_msg = msgnum; s++; } *************** *** 306,312 **** } static ! getws (datesw, msg, smsg) register char *datesw; int msg; register struct smsg *smsg; --- 306,312 ---- } static ! local_getws (datesw, msg, smsg) register char *datesw; int msg; register struct smsg *smsg; *** mh-6.7/zotnet/bboards/getbbent.c Tue Aug 6 13:23:18 1991 --- mh-6.7.new/zotnet/bboards/getbbent.c Fri Aug 7 10:57:32 1992 *************** *** 646,652 **** --- 646,656 ---- hp = item; break; + #ifdef _AIX + case '\0': + #else case NULL: + #endif if ((cp = rindex (bb -> bb_file, '/')) == NULL || *++cp == NULL) (void) strcpy (prf, ""), cp = bb -> bb_file; else *** mh-6.7/zotnet/mf/mf.c Thu Jan 30 17:40:38 1992 --- mh-6.7.new/zotnet/mf/mf.c Fri Aug 7 11:45:17 1992 *************** *** 810,816 **** --- 810,820 ---- if (c == '(') for (*bp++ = c, i = 0;;) switch (c = *cp++) { + #ifdef _AIX + case '\0': + #else case NULL: + #endif cp = NULL; return (last_lex = LX_ERR); case QUOTE: *************** *** 841,847 **** if (c == '"') for (*bp++ = c;;) switch (c = *cp++) { ! case NULL: cp = NULL; return (last_lex = LX_ERR); case QUOTE: --- 845,855 ---- if (c == '"') for (*bp++ = c;;) switch (c = *cp++) { ! #ifdef _AIX ! case '\0': ! #else ! case NULL: ! #endif cp = NULL; return (last_lex = LX_ERR); case QUOTE: *************** *** 862,868 **** if (c == '[') for (*bp++ = c;;) switch (c = *cp++) { ! case NULL: cp = NULL; return (last_lex = LX_ERR); case QUOTE: --- 870,880 ---- if (c == '[') for (*bp++ = c;;) switch (c = *cp++) { ! #ifdef _AIX ! case '\0': ! #else ! case NULL: ! #endif cp = NULL; return (last_lex = LX_ERR); case QUOTE: *************** *** 965,971 **** --- 977,987 ---- pp = NULL; return DONE; + #ifdef _AIX + case '\0': + #else case NULL: + #endif continue; case '\n': *** mh-6.7/zotnet/mts/lock.c Fri Jan 25 12:46:47 1991 --- mh-6.7.new/zotnet/mts/lock.c Fri Aug 7 11:42:26 1992 *************** *** 37,44 **** --- 37,46 ---- #define NULLCP ((char *) 0) #ifdef SYS5 + #ifndef _AIX #define index strchr #define rindex strrchr + #endif #endif SYS5 *** mh-6.7/zotnet/tws/lexedit.sed Thu Apr 5 19:06:01 1990 --- mh-6.7.new/zotnet/tws/lexedit.sed Fri Aug 7 11:04:40 1992 *************** *** 9,11 **** --- 9,20 ---- } } /^struct yysvf *yybgin = yysvec+1;$/d /^int yylineno /,$d + /^# define YYTYPE short/c\ + # define YYTYPE int + /^# define YYTYPE unsigned short/c\ + # define YYTYPE int + /^unsigned char yymatch\[\] = {/c\ + char yymatch[] = { + /^unsigned char yyextra\[\] = {/c\ + char yyextra[] = { + /^if (__once_yylex) {$/,/if(yymbcurmax<=0) yymbcurmax=MB_CUR_MAX;$/d