Prereq: "beta(2) diff -uN 7.2.6-b2/version.h 7.2.6-b3/version.h --- 7.2.6-b2/version.h Sun Nov 17 17:20:53 1996 +++ 7.2.6-b3/version.h Sun Nov 17 17:44:40 1996 @@ -1,7 +1,7 @@ /* @(#)version.h (c) Copyright 1989, 1990, 1991 (Dan Heller) */ #define MUSHNAME "Mail User's Shell" -#define RELEASE_DATE "beta(2) 2/29/96" +#define RELEASE_DATE "beta(3) 11/17/96" #define RELEASE 7 #define REVISION "2" #define PATCHLEVEL 6 diff -uN 7.2.6-b2/COPYING 7.2.6-b3/COPYING --- 7.2.6-b2/COPYING Wed Dec 31 16:00:00 1969 +++ 7.2.6-b3/COPYING Sat Nov 16 20:39:48 1996 @@ -0,0 +1,120 @@ +Sources for Mush are governed by the copyright and license that appear in +the file README in the mush-7.2.5.tar.Z distribution (reproduced below). +In accordance with that license: + + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. "Mush" refers to the computer software identified as the "Mail User's +Shell," and a "work based on Mush" means either Mush or any derivative +work under copyright law: that is to say, a work containing Mush or any +portion of it, either verbatim or with modifications and/or translated +into another language. (Hereinafter, translation is included without +limitation in the term "modification".) + +A "Patch" or "Patches" refers to a human-readable and/or machine-readable +description of one or more modifications to the source code of Mush. +Patches may be combined with the Mush source code by a human reader or by +any of a number of software utilities to produce a derivative work based +on Mush. The act of combining a Patch with the Mush source is termed +the "Application" of the Patch, even if no software utility is involved. + +This License applies to any Patch which is distributed in conjunction +with this License, or which contains a notice placed by the holder of the +copyright for that Patch stating that the Patch may be distributed under +the terms of this License. Any such patch is hereafter termed a "Licensed +Patch". This License further applies to any work based on Mush which +derives from the Application of a License Patch. Any such work based on +Mush is hereafter termed a "Patched Mush". + +The "Program" refers to Mush or to any work based on Mush, including but +not limited to any Patched Mush. + +Each licensee is addressed as "you". + + 1. You may copy and distribute copies of the Mush source code, in any +medium, ONLY AS PERMITTED BY THE NOTICE APPEARING IN THE FILE "README" +in the Mush source. You are expressly PROHIBITED from distributing any +Patched Mush as produced by Application of any Licensed Patch; this +prohibition is required by the notice appearing in "README," which is +reproduced as Section 7 (below). + +You may copy and distribute verbatim copies of any Licensed Patch as you +receive it, in any medium, provided that you keep intact all the notices +that refer to this License and give any other recipients of the Patch a +copy of this License along with the Patch. You may create a new Patch +based on a Patched Mush and distribute that new Patch provided that you +include a notice that refers to this License and give any recipients of +the Patch a copy of this License; that is to say, provided that you +distribute your new Patch as a Licensed Patch. + +IN NO EVENT DOES THIS LICENSE SUPERCEDE ANY LIMITATIONS, WHETHER EXPRESS +OR IMPLIED, THAT ARE PLACED ON DISTRIBUTION OF MODIFICATIONS BY THE TERMS +IN THE FILE "README" INCLUDED IN THE MUSH SOURCES. IF YOU DISTRIBUTE ANY +PATCH, UNDER THE TERMS OF THIS LICENSE OR OTHERWISE, YOU DO SO AT YOUR +OWN RISK. + + 2. You may modify your copy or copies of any Patched Mush, thus forming +a new work based on Mush, provided that you distribute such modifications +only as Licensed Patches and at your own risk, as described in Section 1. +These terms do not apply to modifications that are for personal use only +and that are never distributed, except for preservation of identifying +notices as required by the notice appearing in "README." + + 3. A Patch sometimes includes a description of portions of unmodified +Mush source code to assist in the Application of the Patch. As required +by the notice in "README," you are expressly PROHIBITED from using in +any other product any portions of Mush that may appear in a Patch. + + 4. Any attempt to copy, modify, sublicense or distribute any Licensed +Patch or Patched Mush except as expressly provided under this License is +void, and will automatically terminate your rights under this License. +Further, any such attempt may be legally actionable by the current holder +of the Mush copyright (the "authors" or their assignees). + + NO WARRANTY + + 5. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 6. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + 7. LICENSE NOTICE FROM MUSH 7.2.5 README: + +Mush is copyright (c) 1986, 1987, 1988, 1989, 1990, 1991 by Dan Heller. +All Rights Reserved. This software is not in the public domain. + +Redistribution of the unmodified source code is permitted as long as all +Copyright notices remain intact and all other identifying notices remain +in the code and in the binary. This includes message headers on outgoing +mail and the startup message. Future releases may extract the release +version from the message headers of mush-originated messages to aid in +implementing features and providing backwards compatibility with previous +versions. Modification of the source for personal use is permitted. +Modifications sent to the authors are humbly accepted and it is their +prerogative to make the mods official. Only the "official" sources may be +redistributed and no sale of the code or any part thereof is permitted +without written consent from the authors. Further, no part of the code +may be used in any other product, free or otherwise, without consent from +the authors. Distribution of sources containing adaptations of the SunView +interface to XView or to any X11-based interface is expressly prohibited. + +MUSH IS PROVIDED AS IS, WITHOUT WARRANTY. AUTHORS HEREBY DISCLAIM +ALL WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES +OF FITNESS FOR A PARTICULAR PURPOSE. + + END OF TERMS AND CONDITIONS diff -uN 7.2.6-b2/README 7.2.6-b3/README --- 7.2.6-b2/README Sun Nov 17 17:20:53 1996 +++ 7.2.6-b3/README Sun Nov 17 18:48:30 1996 @@ -5,8 +5,8 @@ Bart Schaefer Network addresses: - argv@z-code.com argv@sun.com argv@ora.com - schaefer@zigzag.z-code.com schaefer@cse.ogi.edu + argv@internezzo.com argv@well.com argv@ora.com + schaefer@brasslantern.com barts@well.com schaefer@zanshin.com When sending mail, mail to the addresses in the order given. @@ -497,6 +497,20 @@ defined, so you must be able to install mush with permission to create files in the mail spool directory. +ROOTMAIL + When running mush from under "su root", the name of the current + user is set to the real user logged in on the terminal. This + makes mail appear to originate from the real user, rather than + from "root", but it also causes "root" to access the real user's + folders, which may cause confusion later (especially if the user + saves mail to new files, which will then be owned by root). To + turn OFF this behavior, define ROOTMAIL. + +MAIL_FROM_POPHOST + When using POP3_SUPPORT, define MAIL_FROM_POPHOST if mush should + hide the client's machine name when creating From: headers for + outbound mail, etc. + --------------- Signals: @@ -588,6 +602,17 @@ DECLARE_ERRLIST Define this if you get unresolved symbol errors for sys_errlist[]. +POSIX_UTIME_USEC + Define this if you have POSIX-style time structures but they also + contain a "modusec" field for microseconds. (Who has this?) + +NCURSES + Define this if you have ncurses but do NOT use the default style of + installation in /usr/include/ncurses/curses.h. When NCURSES is + predefined, mush.h looks for instead. If you have the + standard installation, add -I/usr/include/ncurses to CFLAGS and do + not define NCURSES. + --------------- The sprintf() function: If you *know* your system's sprintf returns a char *, you can remove the @@ -604,6 +629,10 @@ normally be defined for xenix and System-V Unix. If you don't have REGCMP defined, then the routines re_comp() and re_exec() are used (this is the default for mush). + + You can link with regcomp() and regexec() if you define REGCOMP (note + the `O'), rather than regcmp() or re_comp(). This is otherwise like + regcmp()/regex(). Note that some systems do not have either set of routines in the default libraries. You must find the library to use and add it to the list of diff -uN 7.2.6-b2/README-7.2.6 7.2.6-b3/README-7.2.6 --- 7.2.6-b2/README-7.2.6 Wed Dec 31 16:00:00 1969 +++ 7.2.6-b3/README-7.2.6 Sun Nov 17 19:02:02 1996 @@ -0,0 +1,199 @@ + +This is UNOFFICIAL release 7.2.6 of the Mail User's Shell (mush). + + +IMPORTANT NOTICE: + +Copyright ownership of Mush was transferred from Dan Heller to Network +Computing Devices, Inc., in February 1994, as a contingency of the NCD +purchase of Z-Code Software Corporation. Z-Code's product line, Z-Mail, +was sold to NetManage in June of 1996, and ownership of Mush is assumed +to have transferred with it. + +Availablity of Mush 7.2.5 continues to be governed by the license that +appears in the file README in the Mush distribution. Under the terms of +that license, only the UNMODIFIED ("official") Mush source code may be +redistributed. If anyone other than the copyright holder ("authors") +makes changes to the sources, those changed sources MUST NOT be +redistributed. It is unlikely that NCD or NetManage (the new "authors") +has any intrest in promoting Mush, so the "official" Mush is effectively +frozen at version 7.2.5. + +It is the opinion of this writer that, under the "fair use" doctrine of +U.S. copyright law, "patches" of the type produced as the output of the +"diff" utility MAY be distributed SEPARATELY from the unmodified Mush +sources. This is analogous to publishing an errata sheet for a book; +it is a violation of copyright to edit and reproduce the entire book, +but publishing a description of errors the book contains is "fair use" +of the material. However, this writer is not an attorney and cannot +offer legal advice on this matter. Patch at your own risk. + +If you plan to redistribute Mush 7.2.6 or any derivative thereof as a +set of patches, please refer to the file COPYING. + +The changes and corrections included in this patch were contributed by a +large number of mush enthusiasts. I had made an attempt to credit all of +them in a README file that was available for FTP from NCD before the sale +of Z-Mail to NetManage. Unfortunately, that file and all my records of +the identities of contributors were lost when that FTP site and related +machines went away following transfer of ownership to NetManage; all I +have left are items contributed after the beta (2) version of this patch. +Thanks to all of you, whoever you were. + +Changes in compilation: + + Mush should now compile successfully on IRIX, Solaris, BSDI, FreeBSD, + Linux, and other POSIX-like systems. See README for the list of new + makefiles to use, and related new compiler flags. + + NCURSES + Define this if you have ncurses but do NOT use the default style + of installation in /usr/include/ncurses/curses.h. When NCURSES is + predefined, mush.h looks for instead. If you have the + standard installation, add -I/usr/include/ncurses to CFLAGS and do + not define NCURSES. + + ROOTMAIL + When running mush from under "su root", the name of the current + user is set to the real user logged in on the terminal. This + makes mail appear to originate from the real user, rather than + from "root", but it also causes "root" to access the real user's + folders, which may cause confusion later (especially if the user + saves mail to new files, which will then be owned by root). To + turn OFF this behavior, define ROOTMAIL. + + REGCOMP + You can link with regcomp() and regexec() if you define this, + rather than regcmp() or re_comp(). + + POSIX_UTIME_USEC + Define this if you have POSIX-style time structures but they also + contain a "modusec" field for microseconds. (Who has this?) + + MAIL_FROM_POPHOST + When using POP3_SUPPORT, define MAIL_FROM_POPHOST if mush should + hide the client's machine name when creating From: headers for + outbound mail, etc. + +New/changed commands: + + mail + The X-Face: header is now automatically loaded from ~/.face, and + is handled properly in edit-headers mode. + + sort -t + Sorting by the "To" address(es) can now be performed. Note that + any address sorting generally means "group together by address", + not "arrange in order by address", though it may have that as a + side effect. (Aside to Z-Mail users: This is incompatible with + the meaning of "sort -t" in zmail.) + +New/changed variables: + + metamail + Not really new, but documented on-line for the first time, so it + now shows up in tool mode and in "set ?all". + + verify + The field "update" controls whether mush asks before writing back + messages to each folder. + +Tool mode changes: + + Bug fixes only, see below. + +Bugs fixed in Patch #6: + + * Globbing bugfixes formerly distributed in fixed/ subdir are folded in. + Many additional globbing fixes have been included, and comments have + been expanded. + + * Bugfixes in dot-lock file creation, formerly included in the fixed/ + subdirectory, have been folded in. See also NO_FLOCK in README. + + * Lots of compiler warnings and outright errors in function arguments + have been corrected. Thanks to Larry Virden for most of these. + + * Behaves better with respect to 8-bit-clean terminals. + + * Curses mode "update" doesn't query unless the "verify" variable says + it should. + + * Curses mode should work with ncurses now, and uses POSIX cfgetospeed() + when available. (Availability of ncurses is assumed on the basis of + the operating system type, unfortunately.) + + * It should be possible to build mush with CURSES on linux, which as far + as I can tell never worked even though the contributed makefile.linux + included -DCURSES in CFLAGS. The build looks for ncurses in one of + two places (see NCURSES above and makefile.linux). + + * getpath() doesn't needlessly trample on its input path string. + + * "folder" now sets read-only mode by actually attempting to open the + file, rather than examining the return from stat(). This is more + accurate, but may be less efficient. + + * Lots more header fields are now cached in the message structure to + improve speed, at the cost of space. (Not really a bugfix, but ...) + + * Mail from the current user normally shows "TO:
" in the + headers display. This is wrong when there isn't any To: address, so + don't do it in that case. + + * The "current user" now includes any alternates when deciding to show + TO: as described above. This may slow down header display a bit for + users who have alternates. + + * A couple of bugs in generation of reply addresses have been fixed. + I don't recall the exact circumstances. + + * mk_argv() now always works on a temp copy of its first argument, so + that argument may be a string constant if necessary. + + * Macro expansion (bind-macro, map, map!) in curses and CLI modes now + handles failed reads that result from interrupted system calls. + + * Child processes forked to send mail now exit with _exit() to avoid + messing up file descriptors that are still shared with the parent. + + * Status and Priority headers are correctly matched case-INsensitively + during update of folders, so duplication does not accidentally result. + Parsing of Date, Resent-Date, Status, and Priority at folder load time + are case-INsensitive, too. + + * Cobbling togther "From " lines from old UUCP ">From ... remote from ..." + syntax is now case-INsensitive. + + * Folder loading is a little more robust in detecting I/O errors. + + * Mail downloaded with POP3 now gets a "From " line based on the local + client's current time, rather than on the Date: header of the message. + + * A number of serious POP3 message download bugs have been fixed, and + re-prompting should occur for invalid passwords in most cases (fails + if the server is paranoid and won't say why login failed). + + * POP3 mail checks are now delayed if they would interfere with other + activities in progress, including composing a message. + + * This is both a bug fix and a bug: The LAST command, which appeared + briefly in an intermediate POP3 spec only to later be replaced by + the UIDL command, is supported and is used to selectively download + POP mail if the server supports LAST. Ought to be switched to UIDL. + + * In tool mode, some items were being inappropriately erased from the + compose window when it became inactive. Not any more. + + * ok_box() simply prints its argument when not in tool mode. + + * In tool mode, the New Mail icon is shown any time there are unread + messages in the mailbox. + + * In tool mode, Autosign and Fortune toggles show up on the compose + window by default. + + * In tool mode, printing large amounts of text to the main window output + area now works correctly by looping through a series of smaller prints. + + * New mail is added in tool mode without repositioning the display. diff -uN 7.2.6-b2/addrs.c 7.2.6-b3/addrs.c --- 7.2.6-b2/addrs.c Fri Oct 30 11:55:26 1992 +++ 7.2.6-b3/addrs.c Sun Nov 17 15:43:58 1996 @@ -380,6 +380,7 @@ * are addresses from his machine. Reconstruct those addresses to route * thru the senders machine first. */ +void route_addresses(to, cc, route_path) char *to, *cc, *route_path; { @@ -523,6 +524,7 @@ * adds to the length of all the paths, then the original buffer could be * overwritten. someone should check for this! */ +void improve_uucp_paths(original, size, route_path) char *original, *route_path; { @@ -641,6 +643,7 @@ * sendmail or other mailers which append the user's "real name" on the * from lines. See get_name_n_addr(). */ +void rm_cmts_in_addr(str) register char *str; { @@ -660,6 +663,7 @@ for (b--; b > buf && (*b == ',' || isspace(*b)); b--) *b = 0; (void) strcpy(start, buf); + return; } /* @@ -671,6 +675,7 @@ * * Note that the alternates list is an array of addresses stored *reversed*! */ +void take_me_off(str) char *str; { @@ -746,6 +751,7 @@ * within angle brackets *must* already have commas around them or * you can't determine what is a comment and what is an address. */ +void fix_up_addr(str) char *str; { @@ -758,7 +764,7 @@ if (!(p = get_name_n_addr(str, NULL, NULL))) break; c = *p, *p = 0; - if (strlen(str) + (b - buf) >= sizeof(buf) - 2) { + if (strlen(str) + (b - buf) >= (unsigned int)(sizeof(buf) - 2)) { /* wprint("Address too long! Lost address: \"%s\"\n", str); */ *p = c; break; @@ -779,6 +785,7 @@ * Remove redundant addresses. * Assume improve_uucp_paths, fix_up_addr or whatever have already been called. */ +void rm_redundant_addrs(to, cc) char *to, *cc; { @@ -1127,7 +1134,7 @@ c = *p, *p = 0; if (b > buf) { *b++ = ',', *b++ = ' ', *b = '\0'; - if (b - line_start + strlen(str) + 8 /* \t = 8 */ >= n) + if (b - line_start + strlen(str) + 8 /* \t = 8 */ >= (unsigned int)n) *b++ = '\n', *b++ = '\t', line_start = b; } for (b += Strcpy(b, str); b > buf && isspace(*(b-1)); b--) diff -uN 7.2.6-b2/bind.c 7.2.6-b3/bind.c --- 7.2.6-b2/bind.c Fri Oct 30 11:55:27 1992 +++ 7.2.6-b3/bind.c Sun Nov 17 15:43:58 1996 @@ -4,7 +4,8 @@ #include "bindings.h" extern char *c_macro(); -static un_bind(); +static un_bind(), c_bind(), do_bind(); +static void add_bind(); struct cmd_map *cmd_map, *line_map, *bang_map; @@ -17,6 +18,7 @@ * The user's own new bindings, if any, will be displayed * before any of these default bindings. */ +void init_bindings() { #ifdef CURSES @@ -485,6 +487,7 @@ * print current key to command bindings if "str" is NULL. * else return the integer "m_cmd" which the str is bound to. */ +static c_bind(str, opts) register char *str; register struct cmd_map *opts; @@ -533,6 +536,7 @@ * args is currently the execute string of a macro mapping, but may be * used in the future as an argument string for any curses command. */ +static do_bind(str, func, args, map_list) register char *str, *args; struct cmd_map **map_list; @@ -573,6 +577,8 @@ * to get the macro/map/binding expanded. This must in in raw format: no * \n's to mean \015. Convert first using m_xlate(). */ +static +void add_bind(str, func, args, map_list) register char *str, *args; struct cmd_map **map_list; diff -uN 7.2.6-b2/command2.c 7.2.6-b3/command2.c --- 7.2.6-b2/command2.c Fri Oct 30 11:55:27 1992 +++ 7.2.6-b3/command2.c Sun Nov 17 15:43:58 1996 @@ -246,7 +246,7 @@ char *argv[], list[]; { int edited = 0; - char buf[MAXPATHLEN], *b, *dir, **edit_cmd, *editor, *mktemp(); + char buf[MAXPATHLEN], *b, *dir, **edit_cmd, *editor; u_long flags = 0L; char *cmd = *argv; FILE *fp; diff -uN 7.2.6-b2/commands.c 7.2.6-b3/commands.c --- 7.2.6-b2/commands.c Fri Oct 30 11:55:28 1992 +++ 7.2.6-b3/commands.c Sun Nov 17 15:43:58 1996 @@ -2,6 +2,8 @@ #include "mush.h" +static toggle_debug(), preserve(), respond(); + /* * Note that all of the routines in here act upon and return 0 or -1. * if -1, then the main loop will clear message lists. @@ -81,6 +83,7 @@ { NULL, mush_quit } }; +static toggle_debug(argc, argv) int argc; char **argv; @@ -189,7 +192,7 @@ break; } #endif /* SUNTOOL */ - display_msg(x, flg); + display_msg(x, (u_long)flg); } #ifdef SUNTOOL if (istool > 1) @@ -198,6 +201,7 @@ return 0; } +static preserve(n, argv, list) int n; /* no use for argc, so use space for a local variable */ char **argv, list[]; @@ -483,6 +487,7 @@ return 0; } +static respond(n, argv, list) int n; /* no use for argc, so use its address space for a variable */ char **argv, *list; @@ -753,9 +758,9 @@ static sorter(cmd1, cmd2) -register struct cmd *cmd1, *cmd2; +register void *cmd1, *cmd2; { - return strcmp(cmd1->command, cmd2->command); + return strcmp((char *)((struct cmd *)cmd1)->command, (char *)((struct cmd *)cmd2)->command); } question_mark(x, argv) @@ -776,12 +781,12 @@ for (x = 0; x < N * 5; x++) { if (!(x % 5)) - if (!(p = Cmds[n++] = malloc(80))) { + if (!(p = Cmds[n++] = (char *) malloc(80))) { error("malloc in question_mark()"); free_vec(Cmds); return -1; } - if (x%5*N+n < sizeof cmds / sizeof (struct cmd)) + if ((x%5*N+n) < (sizeof cmds / sizeof (struct cmd))) p += strlen(sprintf(p, "%-14.14s ", cmds[x%5*N+n-1].command)); } Cmds[n++] = savestr("Type: `command -?' for help with most commands."); diff -uN 7.2.6-b2/curs_io.c 7.2.6-b3/curs_io.c --- 7.2.6-b2/curs_io.c Sun Nov 17 17:20:52 1996 +++ 7.2.6-b3/curs_io.c Sun Nov 17 15:43:58 1996 @@ -5,11 +5,13 @@ #include "bindings.h" #include "glob.h" +static check_map(), line_wrap(); + #if defined(IRIX4) && defined(SELECT) #include #endif -static backspace(); +static void backspace(); #if !defined(M_XENIX) || (defined(M_XENIX) && !defined(CURSES)) char *_unctrl[] = { @@ -46,6 +48,7 @@ char complete; /* word completion, usually ESC */ char complist; /* completion listing, usually ^D */ +void tty_settings() { int is_tty = isatty(0); @@ -345,6 +348,7 @@ } static +void backspace(str, n) register char *str; int *n; @@ -357,6 +361,7 @@ if (wrapcolumn) wrapcolumn++; } + return; } #undef Addch @@ -368,6 +373,7 @@ * currently active mapping) until a match happens or we've determined * that there is no match. */ +static check_map(c, map_list) char c; struct cmd_map *map_list; @@ -473,6 +479,7 @@ * * Returns 1 if the line was wrapped, 0 if not. */ +static line_wrap(string, count) char *string; /* The string to be wrapped */ int *count; /* Offset of string terminator */ @@ -605,7 +612,7 @@ overstrike = 0; } if (ignore || !showlist) { - if (expandall || strlen(exp[0]) > len) { + if (expandall || (strlen(exp[0]) > (unsigned int)len)) { if (!showlist) Debug("%s", string); if (overstrike && (prefix || expandall || f == 1)) { diff -uN 7.2.6-b2/curses.c 7.2.6-b3/curses.c --- 7.2.6-b2/curses.c Sun Nov 17 17:20:52 1996 +++ 7.2.6-b3/curses.c Sun Nov 17 18:48:04 1996 @@ -57,7 +57,7 @@ (void) signal(SIGTSTP, stop_start); (void) signal(SIGCONT, stop_start); #endif /* SIGCONT */ -#if !defined(SYSV) && !defined(USG) +#if !defined(SYSV) && !defined(USG) && !defined(__NCURSES_H) if (!UP || !*UP) #else /* ~SYSV && ~USG */ if (!stdscr) @@ -806,12 +806,13 @@ return 1; /* make sure bottom line is clear and no reverse video */ } +void scrn_line(line, buf) char *buf; { #if !defined(AIX) && !defined(BSD44) #ifndef A_CHARTEXT -#ifdef NCURSES +#ifdef __NCURSES_H (void) strncpy(buf, stdscr->lines[line], COLS-1); #else (void) strncpy(buf, stdscr->_y[line], COLS-1); @@ -828,6 +829,7 @@ #else /* AIX */ (void) strncpy(buf, compose_hdr(n_array[line-1]), COLS - 1); #endif /* AIX */ + return ; } /* @@ -909,6 +911,7 @@ return siz; } +void set_screen_size() { int hlp_siz = LINES - 2 - curses_help_msg(FALSE); @@ -978,6 +981,7 @@ return 1; } +void curs_vars(which) int which; /* really, a char */ { @@ -1045,5 +1049,6 @@ putchar('\n'); else (void) curses_help_msg(TRUE); + return; } #endif /* CURSES */ diff -uN 7.2.6-b2/dates.c 7.2.6-b3/dates.c --- 7.2.6-b2/dates.c Sun Nov 17 17:20:49 1996 +++ 7.2.6-b3/dates.c Sun Nov 17 15:43:58 1996 @@ -281,7 +281,7 @@ /* day_number month_name year_number time-timezone (day) */ /* ^no colon separator */ - if (sscanf(p, "%d %s %d %2d%2d%1[-+]%6[0123456789]", + if (sscanf(p, "%d %s %d %2d%2d%2d%1[-+]%6[0123456789]", &Day, month, &Year, &Hours, &Mins, &Secs, &Zone[0], &Zone[1]) == 8) goto gotit; if (sscanf(p, "%d %s %d %2d%2d-%7s", /* Does this _ever_ hit? */ diff -uN 7.2.6-b2/execute.c 7.2.6-b3/execute.c --- 7.2.6-b2/execute.c Sun Nov 17 17:20:49 1996 +++ 7.2.6-b3/execute.c Sun Nov 17 15:43:58 1996 @@ -85,7 +85,7 @@ } #endif /* SUNTOOL */ -execute(argv) +int execute(argv) char **argv; { #if defined(SYSV) || defined(POSIX) || defined (BSD44) @@ -137,6 +137,7 @@ (void) signal(SIGCONT, oldcont); #endif /* SIGCONT */ turnoff(glob_flags, IGN_SIGS); + return(0); } SIGRET diff -uN 7.2.6-b2/file.c 7.2.6-b3/file.c --- 7.2.6-b2/file.c Sun Nov 17 17:20:49 1996 +++ 7.2.6-b3/file.c Sun Nov 17 15:43:58 1996 @@ -36,7 +36,7 @@ * look for ~user or ~user/subpath * if '/' exists, separate into tmp="user" p="subpath" */ - struct passwd *ent, *getpwnam(); + struct passwd *ent; char tmp[MAXPATHLEN], *p2 = tmp+1; strcpy(tmp, p); if (p = index(p2, '/')) diff -uN 7.2.6-b2/folders.c 7.2.6-b3/folders.c --- 7.2.6-b2/folders.c Sun Nov 17 17:20:49 1996 +++ 7.2.6-b3/folders.c Sun Nov 17 15:43:58 1996 @@ -423,7 +423,7 @@ { int r, articles = 0, merge = 0, appending = 0; char buf[MAXPATHLEN], cmdbuf[MAXPATHLEN], newlist[MAXMSGS_BITS], *dir; - char *art_sep = ARTICLE_SEP, *mktemp(); + char *art_sep = ARTICLE_SEP; FILE *fp; while (argv && *++argv && **argv == '-') { diff -uN 7.2.6-b2/glob.c 7.2.6-b3/glob.c --- 7.2.6-b2/glob.c Sun Nov 17 17:20:52 1996 +++ 7.2.6-b3/glob.c Sun Nov 17 15:43:58 1996 @@ -11,8 +11,11 @@ #include #endif /* BSD */ #endif /* TEST */ + #include "glob.h" +static int fxp(), pglob(), dglob(), fglob(), fglob(), sxp(); + #ifndef BSD #undef bcopy #define bcopy(s,d,n) memcpy(d,s,n) @@ -196,6 +199,7 @@ /* * Speedier vector append when sizes are known */ +static catv(s1, v1, s2, v2) int s1, s2; char ***v1, **v2; @@ -228,6 +232,7 @@ /* * Make a string into a one-element vector */ +static char ** unitv(s) char *s; @@ -272,10 +277,14 @@ * String comparison function for qsort. An empty string is greater * than any other, otherwise strcmp is used. */ +static int -strptrcmp(p1, p2) -char **p1, **p2; +strptrcmp(v1, v2) +void *v1, *v2; { + char **p1, **p2; + + p1 = (char **)v1; p2 = (char **)v2; if (!**p1 || !**p2) return **p2 - **p1; return strcmp(*p1, *p2); @@ -287,6 +296,7 @@ * Moves the redundant stuff to the end, in case it needs to be deallocated * or something. */ +static int crunch(base, nel, width, cmp) char *base; @@ -318,6 +328,7 @@ /* * Qsort and remove duplicates. Returns the final number of entries. */ +static int qsort_and_crunch(base, nel, width, cmp) char *base; @@ -377,6 +388,7 @@ * The list of expansions is placed in *exp, and the number of matches * is returned, or -1 on an error. */ +static int fxp(name, exp) char *name, ***exp; @@ -408,6 +420,7 @@ * and returned even when there are no matches (ala csh generation of names * from pattern sets). pglob() still returns zero in this case. */ +static int pglob(path, skip, exp) char *path, ***exp; @@ -503,6 +516,7 @@ * * Matches are returned through *exp. */ +static int dglob(dir, pat1, pat2, exp) char *dir, *pat1, *pat2, ***exp; @@ -551,6 +565,7 @@ /* * Match file names. This means that metachars do not match leading ".". */ +static int fglob(str, pat) char *str, *pat; @@ -766,6 +781,7 @@ * Pre-expand pattern set notations so sets containing "/" separators * can be globbed successfully. Returns the number of expansions. */ +static int sxp(pat, exp) char *pat, ***exp; @@ -938,7 +954,7 @@ * Also remember the minimum width. */ for (minwidth = MAXWIDTH, maxwidth = n = 0; n < argc; n++) { - widths[n] = max(strlen(argv[n] + skip) + 2, MINWIDTH); + widths[n] = max(strlen(argv[n] + skip) + 2, (unsigned int)MINWIDTH); if (widths[n] > MAXWIDTH - MINWIDTH) break; if (widths[n] > maxwidth) { diff -uN 7.2.6-b2/hdrs.c 7.2.6-b3/hdrs.c --- 7.2.6-b2/hdrs.c Sun Nov 17 17:20:51 1996 +++ 7.2.6-b3/hdrs.c Sun Nov 17 15:43:58 1996 @@ -354,7 +354,7 @@ if (list) unset_msg_bit(list, n); if (debug) { - (void) printf("msg[%d].m_flags: %d", n, msg[n].m_flags); + (void) printf("msg[%d].m_flags: %d", n, (int)msg[n].m_flags); (void) check_flags(msg[n].m_flags); } } @@ -576,7 +576,7 @@ } otherwise: continue; /* unknown formatting char */ } - if (do_pad && pad && strlen(p2) > pad) { + if (do_pad && pad && strlen(p2) > (unsigned int)pad) { char *old_p2 = p2, *p3; int is_bangform = 0; /* if addr is too long, move pointer forward till the @@ -592,7 +592,7 @@ break; } } - if (isauthor && p2 > old_p2+4 && !p3 && strlen(p2) + 4 > pad) + if (isauthor && p2 > old_p2+4 && !p3 && strlen(p2) + 4 > (unsigned int)pad) p2 -= 4; if (is_bangform && (p3 = rindex(p2, '@'))) { len = strlen(p3); diff -uN 7.2.6-b2/init.c 7.2.6-b3/init.c --- 7.2.6-b2/init.c Sun Nov 17 17:20:50 1996 +++ 7.2.6-b3/init.c Sun Nov 17 15:43:58 1996 @@ -16,10 +16,10 @@ init() { char *home, *realname, *argv[4]; - extern char *getlogin(); char buf[MAXPATHLEN]; #if defined(SYSV) && !defined(HPUX) && !defined(IRIX4) -#ifndef __linux__ +#if !defined(__linux__) && !defined(POSIX) + extern char *getlogin(); extern struct passwd *getpwuid(); /* sys-v forgot this in pwd.h! */ #endif struct utsname ourhost; diff -uN 7.2.6-b2/lock.c 7.2.6-b3/lock.c --- 7.2.6-b2/lock.c Sun Nov 17 17:20:52 1996 +++ 7.2.6-b3/lock.c Sun Nov 17 18:50:03 1996 @@ -1,7 +1,10 @@ +#if 0 #ifdef linux /* apparently, linux likes USG locks */ #define USG #define SYSV +#undef CURSES +#endif #endif /* @@ -130,6 +133,7 @@ #endif /* LOCK_PROG */ +static dot_lock(filename) char *filename; { @@ -195,6 +199,7 @@ #endif /* LOCK_PROG */ } +static dot_unlock(filename) char *filename; { @@ -281,6 +286,7 @@ #define F_SETLKW F_SETLK #endif /* F_SETLKW */ +int flock(fd, op) int fd, op; { diff -uN 7.2.6-b2/loop.c 7.2.6-b3/loop.c --- 7.2.6-b2/loop.c Sun Nov 17 17:20:50 1996 +++ 7.2.6-b3/loop.c Sun Nov 17 15:43:58 1996 @@ -14,6 +14,7 @@ #else #ifndef SYSV #include +#include #endif /* SYSV */ #endif /* BSD */ @@ -42,7 +43,7 @@ static char *last_aliased; static int hist_size, print_only; -do_loop() +int do_loop() { register char *p, **argv; char **last_argv = DUBL_NULL, line[256]; @@ -151,12 +152,14 @@ } else if (argc > -1) (void) do_command(argc, argv, msg_list); } + /* NOTREACHED */ + return(0); } /* Add a command to the history list */ /*ARGSUSED*/ -add_history(un_used, argv) +int add_history(un_used, argv) char **argv; { struct history *new; @@ -189,6 +192,7 @@ xfree((char *) (hist_tail->prev)); hist_tail->prev = NULL_HIST; } + return(0); } /* make a command from "buf". @@ -1199,7 +1203,7 @@ # endif #else char *rex = NULL; - extern char *regcmp(); + /*extern char *regcmp(); */ #endif /* REGCMP */ /* For !{something}, the {} are stripped in reference_hist() */ @@ -1341,8 +1345,9 @@ return 0; } -init_history(newsize) +int init_history(newsize) { if ((hist_size = newsize) < 1) hist_size = 1; + return 0; } diff -uN 7.2.6-b2/macros.c 7.2.6-b3/macros.c --- 7.2.6-b2/macros.c Sun Nov 17 17:20:50 1996 +++ 7.2.6-b3/macros.c Sun Nov 17 15:43:59 1996 @@ -5,7 +5,8 @@ extern struct cmd_map map_func_names[]; -struct cmd_map *mac_stack, *mac_hide; +static struct cmd_map *mac_stack; +struct cmd_map *mac_hide; /* * print current binding to macro mappings if "str" is NULL. @@ -246,6 +247,7 @@ } } +int m_ungetc(c) char c; { @@ -253,6 +255,7 @@ *(--(mac_stack->m_str)) = c; else (void) ungetc(c, stdin); + return 0; } /* diff -uN 7.2.6-b2/mail.c 7.2.6-b3/mail.c --- 7.2.6-b2/mail.c Sun Nov 17 17:20:53 1996 +++ 7.2.6-b3/mail.c Sun Nov 17 15:48:38 1996 @@ -24,7 +24,7 @@ static jmp_buf cntrl_c_buf; static char *Hfile, *edfile; FILE *ed_fp; -char *hfile, *mktemp(); +static char *hfile; /* argc and argv could be null if coming from tool mode compose */ do_mail(n, argv, list) @@ -506,7 +506,7 @@ #endif /* SUNTOOL */ if (ison(flags, SEND_NOW)) { /* editing couldn't have been on -- finish_up_letter() failed */ - rm_edfile(0 - ison(flags, FORWARD)); + rm_edfile((int)(0 - ison(flags, FORWARD))); return -1; } @@ -1740,7 +1740,7 @@ (*Subject || for_editor && (do_set(set_options, "ask") || do_set(set_options, "asksub")))) (void) fprintf(files[i], "Subject: %s\n", Subject); - } else if (subj && *subj && strlen(subj) > 9) + } else if (subj && *subj && strlen(subj) > (unsigned int)9) (void) (fputs(subj, files[i]), fputc('\n', files[i])); if (*Cc || for_editor && do_set(set_options, "askcc")) (void) fprintf(files[i], "%sCc: %s\n", @@ -1777,6 +1777,7 @@ /* ARGSUSED */ SIGRET rm_edfile(sig) +int sig; { if (sig > 0) { char *fix; @@ -1837,6 +1838,7 @@ } /* save letter into dead letter */ +void dead_letter(sig) int sig; /* signal passed to rm_edfile() or 0 */ { diff -uN 7.2.6-b2/main.c 7.2.6-b3/main.c --- 7.2.6-b2/main.c Sun Nov 17 17:20:50 1996 +++ 7.2.6-b3/main.c Sun Nov 17 15:43:59 1996 @@ -320,6 +320,7 @@ } #endif /* SUNTOOL */ do_loop(); + return 0; } do_version() @@ -329,6 +330,7 @@ } /* set the current working directory */ +void set_cwd() { char cwd[MAXPATHLEN]; @@ -345,4 +347,5 @@ argv[3] = NULL; (void) add_option(&set_options, argv); } + return ; } diff -uN 7.2.6-b2/makefile.linux 7.2.6-b3/makefile.linux --- 7.2.6-b2/makefile.linux Sun Nov 17 17:20:50 1996 +++ 7.2.6-b3/makefile.linux Sun Nov 17 18:58:52 1996 @@ -23,9 +23,17 @@ DEBUG=-O6 # DEBUG=-g -CFLAGS= $(DEBUG) -DPOSIX -DSIGRET=void -fwritable-strings -DCURSES + +# There are apparently at least two major variants of Linux; one has ncurses +# installed in /usr/include/ncurses.h, the other has the standard ncurses +# installation using /usr/include/ncurses/curses.h. The former of these +# apparently has the ncurses library installed as -lcurses, whereas the latter +# has a separate -lncurses. Set CFLAGS and LIBS here as appropriate. +CFLAGS= $(DEBUG) -DPOSIX -DSIGRET=void -fwritable-strings -DCURSES -I/usr/include/ncurses +#CFLAGS= $(DEBUG) -DPOSIX -DSIGRET=void -fwritable-strings -DCURSES -DNCURSES LDFLAGS= $(DEBUG) -LIBS= -lcurses -ltermcap +LIBS= -lncurses -ltermcap +#LIBS= -lcurses -ltermcap OTHERLIBS= # Use some variant of this one if you #define MMDF in config.h #OTHERLIBS=/usr/src/mmdf/lib/libmmdf.a diff -uN 7.2.6-b2/makefile.solaris 7.2.6-b3/makefile.solaris --- 7.2.6-b2/makefile.solaris Sun Nov 17 17:20:53 1996 +++ 7.2.6-b3/makefile.solaris Sun Nov 17 16:24:51 1996 @@ -24,9 +24,9 @@ # # # -CFLAGS= -O2 -g -DSYSV -DUSG -DCURSES -DSIGRET=void -DSVR4 -DREGCMP -DDECLARE_ERRLIST +CFLAGS= -O2 -g -DPOSIX -DSYSV -DUSG -DCURSES -DSIGRET=void -DSVR4 -DREGCMP -DDECLARE_ERRLIST LDFLAGS= -g -LIBS= -L/usr/ccs/lib -lcurses -lgen -ltermlib -lsocket -lnsl -lc /usr/ucblib/libucb.a +LIBS= -L/usr/ccs/lib -R/usr/ccs/lib -lcurses -lgen -ltermlib -lsocket -lnsl -lc /usr/ucblib/libucb.a OTHERLIBS= # Use some variant of this one if you #define MMDF in config.h #OTHERLIBS=/usr/src/mmdf/lib/libmmdf.a diff -uN 7.2.6-b2/makefile.sys.v 7.2.6-b3/makefile.sys.v --- 7.2.6-b2/makefile.sys.v Sun Nov 17 17:20:53 1996 +++ 7.2.6-b3/makefile.sys.v Sun Nov 17 16:26:08 1996 @@ -32,7 +32,6 @@ # System V Release 4 (SunOS 5?) should add -DSVR4 -DDIRECTORY to CFLAGS and # should replace -lPW with -lgen - CFLAGS= -O -DSYSV -DUSG -DCURSES -DREGCMP -DSIGRET=void LDFLAGS= LIBS= -lcurses -lPW diff -uN 7.2.6-b2/malloc.c 7.2.6-b3/malloc.c --- 7.2.6-b2/malloc.c Thu May 16 18:29:38 1991 +++ 7.2.6-b3/malloc.c Sun Nov 17 15:43:59 1996 @@ -18,6 +18,7 @@ * Also, the mush xfree() and free_vec() functions have been moved here. */ +#define NO_STDLIB 1 #include "mush.h" /* @@ -31,6 +32,8 @@ #define free xfree /* rename free for mush purposes */ /* Begin modified perl malloc.c */ +static void morecore(); +static findbucket(); /* Header: malloc.c,v 2.0 88/06/05 00:09:16 root Exp * @@ -107,7 +110,9 @@ */ #define NBUCKETS 30 static union overhead *nextf[NBUCKETS]; +#ifndef POSIX extern char *sbrk(); +#endif #ifdef MSTATS /* @@ -149,7 +154,7 @@ return (NULL); /* remove from linked list */ if (*((int*)p) > 0x10000000) - Debug("Corrupt malloc ptr 0x%x at 0x%x\n",*((int*)p),p); + Debug("Corrupt malloc ptr 0x%x at 0x%x\n",*((int*)p),(int)p); nextf[bucket] = nextf[bucket]->ov_next; p->ov_magic = MAGIC; p->ov_index= bucket; @@ -173,6 +178,7 @@ * Allocate more memory to the indicated bucket. */ static +void morecore(bucket) register bucket; { @@ -218,11 +224,12 @@ op->ov_next = (union overhead *)((caddr_t)op + siz); op = (union overhead *)((caddr_t)op + siz); } + return; } void free(cp) - char *cp; + void *cp; { register int size; register union overhead *op; @@ -425,7 +432,7 @@ void xfree(cp) -char *cp; +void *cp; { extern char end[]; diff -uN 7.2.6-b2/misc.c 7.2.6-b3/misc.c --- 7.2.6-b2/misc.c Sun Nov 17 17:20:50 1996 +++ 7.2.6-b3/misc.c Sun Nov 17 15:43:59 1996 @@ -218,6 +218,7 @@ return ret_val; } +void glob_test(s) char *s; { @@ -269,6 +270,7 @@ if (ison(glob_flags, QUOTE_MACRO)) print_more(" QUOTE_MACRO"); print_more("\n"); + return; } /* @@ -336,7 +338,7 @@ if (!msg_bit(list, i)) continue; else if (!newflag) { - wprint("msg %d: offset: %d, lines: %d, bytes: %d, flags:", i+1, + wprint("msg %d: offset: %ld, lines: %d, bytes: %ld, flags:", i+1, msg[i].m_offset, msg[i].m_lines, msg[i].m_size); if (ison(msg[i].m_flags, UNREAD)) wprint(" UNREAD"); diff -uN 7.2.6-b2/msgs.c 7.2.6-b3/msgs.c --- 7.2.6-b2/msgs.c Sun Nov 17 17:20:52 1996 +++ 7.2.6-b3/msgs.c Sun Nov 17 15:43:59 1996 @@ -1,6 +1,9 @@ /* @(#)msgs.c (c) copyright 10/18/86 (Dan Heller) */ #include "mush.h" +#include + +static void parse_from(); void display_msg(n, flg) @@ -739,6 +742,8 @@ * to UUCP path form. * g. Append the saved username to return_path. */ +static +void parse_from(fp, path) FILE *fp; char path[]; @@ -770,6 +775,7 @@ save_offset = ftell(fp); } (void) fseek(fp, save_offset, L_SET); + return ; } /* @@ -793,7 +799,7 @@ char buf[BUFSIZ]; int lines = 0, msg_found = 0, had_error = 1; int get_status = 1, cnt; - long bytes, ftell(); + long bytes; struct msg old; char *p, date[64]; FILE *fp; diff -uN 7.2.6-b2/mush.h 7.2.6-b3/mush.h --- 7.2.6-b2/mush.h Sun Nov 17 17:20:53 1996 +++ 7.2.6-b3/mush.h Sun Nov 17 18:35:56 1996 @@ -3,11 +3,16 @@ #include "config.h" /* POSIX -- a collection of standardized parts from SYSV and BSD */ -#ifdef POSIX +#if defined(POSIX) || defined(BSD44) #include +#ifndef NO_STDLIB #include +#endif #define SIGRET void #endif +#ifdef SVR4 +#include +#endif /* STDC -- i.e. ANSI C, a collection of standardized modifications to * the C language, often accompanied by [partial] POSIX compliance @@ -31,10 +36,11 @@ #endif /* SYSV */ #endif /* POSIX */ -#ifndef __linux__ -# include -#else +#ifdef NCURSES +# undef NCURSES # include +#else +# include #endif #ifdef timeout @@ -53,7 +59,7 @@ #else /* CURSES */ #include -#ifdef POSIX +#if defined(POSIX) || defined(SVR4) #include #else /* POSIX */ #if defined(SYSV) && defined(USG) || defined(AIX) @@ -69,6 +75,10 @@ #include #endif /* HPUX */ +#ifdef HPUX +#include +#endif /* HPUX */ + #if defined(SVR4) #include #endif /* SVR4 */ @@ -289,6 +299,9 @@ #define nocbreak() cbrkoff() #else /* CURSES */ +#ifdef POSIX +typedef struct termios SGTTY; +#endif /* If curses is defined, use the echo/cbreak commands in library only * if curses is running. If curses isn't running, use macros above. */ @@ -664,15 +677,55 @@ close_lock(), /* unlock and close a file opened by lock_fopen() */ - mush_quit(), do_alias(), respond(), cd(), sh(), stop(), - folder(), folders(), merge_folders(), do_undigest(), mark_msg(), - save_msg(), delete(), do_mail(), lpr(), alts(), set(), do_hdrs(), - save_opts(), preserve(), sort(), readmsg(), edit_msg(), eval_cmd(), - do_pick(), print_help(), question_mark(), do_from(), my_stty(), - do_version(), disp_hist(), source(), do_echo(), ls(), pipe_msg(), - await(), nopenfiles(), file_to_fp(), - check_new_mail(), get_new_mail(), show_new_mail(), - Setenv(), Unsetenv(), Printenv(), msg_flags(), toggle_debug(); + Access(), do_pick(), mush_quit(), + Getstr(), do_undigest(), my_stty(), + Printenv(), do_version(), next_msg(), + Setenv(), nopenfiles(), + Strcpy(), edit_msg(), open_list(), + Unsetenv(), emptyfile(), + add_history(), eval_cmd(), + add_option(), exec_argv(), pipe_msg(), + add_to_letter(), execute(), prefix(), + preparse_opts(), + alias_stuff(), fignore(), + alts(), file_to_fp(), print_help(), + await(), filexp(), question_mark(), + cd(), find_files(), reserve(), + c_more(), read_long_cmd(), + do_from(), readmsg(), + check_flags(), folder(), reserved_cmd(), + check_mac_bindings(), folders(), + check_new_mail(), + chk_msg(), gdiffv(), + chk_two_lists(), get_msg_list(), save_msg(), + closefileds(), get_new_mail(), save_opts(), + getcmd(), search(), + cmd_line(), glob(), set(), + columnate(), help(), + compare_addrs(), hit_return(), + completion(), sh(), + copy_msg(), init_history(), show_new_mail(), + copyback(), lcase_strncmp(), sort(), + lcprefix(), source(), + curses_commad(), specl_hdrs(), + curses_help_msg(), src_parse(), + curses_msg_list(), load_folder(), stop(), + load_xface(), + delete(), long_mac_cmd(), + lpr(), test_folder(), + disp_hist(), ls(), + do_alias(), m_getchar(), + do_command(), m_ungetc(), un_set(), + do_echo(), mac_pending(), undigest(), + mail_size(), varexp(), + do_hdrs(), mark_msg(), vrfy_update(), + do_loop(), merge_folders(), xcreat(), + do_mail(), month_to_n(), curses_command(), + do_pager(), msg_flags(), + mac_queue() +; + +char * quoteit(); #ifndef SIGRET #define SIGRET int @@ -692,6 +745,13 @@ void error(), getmail(), mail_status(), sign_letter(), + dead_letter(), set_cwd(), glob_test(), + clr_bot_line(), parse_options(), init_bindings(), + tty_settings(), free_elems(), set_screen_size(), curs_vars(), + scrn_line(), route_addresses(), improve_uucp_paths(), + rmt_cmts_in_addr(), improve_uucp_paths(), take_me_off(), + fix_up_addr(), rm_redundant_addrs(), list_to_str(), + droplocks(), rm_cmts_in_addr(), init(), display_msg(), cleanup(), fs_error(); /* printf(), fclose(), fflush(), fputs(), fputc() */ #ifdef TIOCGLTC diff -uN 7.2.6-b2/options.c 7.2.6-b3/options.c --- 7.2.6-b2/options.c Fri Oct 30 11:55:40 1992 +++ 7.2.6-b3/options.c Sun Nov 17 15:43:59 1996 @@ -8,7 +8,7 @@ * listed AFTER the flag it prefixes in the list below */ -char *word_flags[][2] = { +static char *word_flags[][2] = { { "-bcc", "-b" }, { "-blindcarbon", "-b" }, { "-blind", "-b" }, @@ -45,6 +45,8 @@ { NULL, NULL } /* This must be the last entry */ }; +static +void fix_word_flag(argp) register char **argp; { @@ -163,6 +165,7 @@ #endif /* CURSES */ #endif /* SUNTOOL */ +void parse_options(argvp, flags) register char ***argvp; struct mush_flags *flags; @@ -347,4 +350,5 @@ print("You must specify a draft file to autosend\n"); exit(1); } + return ; } diff -uN 7.2.6-b2/pick.c 7.2.6-b3/pick.c --- 7.2.6-b2/pick.c Sun Nov 17 17:20:51 1996 +++ 7.2.6-b3/pick.c Sun Nov 17 15:43:59 1996 @@ -2,6 +2,8 @@ #include "mush.h" +static find_pattern(), date1(), ago_date(); + static int before, after, search_from, search_subj, search_to, xflg, icase; static u_long match_priority; static char search_hdr[64]; @@ -182,7 +184,7 @@ return -1; } } - search = (pattern[0] || mdy[1] || match_priority > 0); + search = (pattern[0] || mdy[1] || (match_priority != 0)); if (verbose) { if (head_cnt + tail_cnt >= 0) { print("Finding the "); @@ -207,7 +209,7 @@ print_more(" of the last %d", tail_cnt); } else print_more("Searching for %smessages", - match_priority > 0 ? "priority " : ""); + match_priority != 0 ? "priority " : ""); if (!search) { if (tail_cnt > 0 && head_cnt > 0) print_more(" messages"); @@ -288,6 +290,7 @@ * the list of messages which have matched the pattern. * return -1 for internal error or # of pattern matches. */ +static find_pattern(cnt, p, check_list, ret_list) int cnt; register char *p; @@ -299,7 +302,9 @@ char buf[HDRSIZ]; char *err = NULL; #ifdef REGCMP +#ifndef POSIX char *regcmp(), *regex(); +#endif #else /* REGCMP */ # ifdef REGCOMP char *regcomp(), *regexec(); @@ -343,7 +348,7 @@ /* start searching: set bytes, and message number: n */ for (n = 0; cnt && n < msg_cnt; n++) if (msg_bit(check_list, n)) { - if (match_priority > 0) { + if (match_priority != 0) { if (msg[n].m_flags & match_priority) ++matches, set_msg_bit(ret_list, n); continue; @@ -466,7 +471,9 @@ static char *err = (char *)-1, direction; SIGRET (*oldint)(), (*oldquit)(); #ifdef REGCMP +#ifndef POSIX char *regex(), *regcmp(); +#endif #else /* REGCMP */ # ifdef REGCOMP char *regcomp(), *regexec(); @@ -586,6 +593,7 @@ * parse a user given date string and set mdy[] array with correct * values. Return 0 on failure. */ +static date1(p) register char *p; { @@ -645,6 +653,7 @@ * * Return number of args parsed; -1 on error. */ +static ago_date(argv) char **argv; { diff -uN 7.2.6-b2/print.c 7.2.6-b3/print.c --- 7.2.6-b2/print.c Sun Nov 17 17:20:52 1996 +++ 7.2.6-b3/print.c Sun Nov 17 15:43:59 1996 @@ -111,7 +111,7 @@ /* don't wrap the line! Just print it and refresh() */ printw("%-.*s", len, p), clrtoeol(), refresh(); /* if length(p) (remainder of msgbuf) doesn't wrap, break loop */ - if ((x += strlen(p)) < COLS-1) + if ((x += strlen(p)) < (unsigned int)(COLS-1)) break; /* the next print will overwrite bottom line, so \n first */ putchar('\n'), move(LINES-1, x = 0); /* reset x */ @@ -129,9 +129,11 @@ #endif /* SUNTOOL || CURSES */ /* for curses mode */ +void clr_bot_line() { print(""); + return; } #ifdef SUNTOOL diff -uN 7.2.6-b2/setopts.c 7.2.6-b3/setopts.c --- 7.2.6-b2/setopts.c Fri Oct 30 11:55:42 1992 +++ 7.2.6-b3/setopts.c Sun Nov 17 15:43:59 1996 @@ -3,6 +3,8 @@ #include "mush.h" #include "bindings.h" +static void save_list(), save_cmd(); + static void insert_option(list, opt, order) struct options **list, *opt; @@ -685,6 +687,8 @@ #undef other_quote } +static +void save_list(title, list, command, equals, fp) struct options *list; register char *command, *title, equals; @@ -717,7 +721,7 @@ (void) fputc(equals? equals: ' ', fp); (void) fprintf(fp, "%s%s%s", quote, - quoteit(opts->value, quote, TRUE), + quoteit(opts->value, (int)(*quote), TRUE), quote); } (void) fputc('\n', fp); @@ -726,6 +730,8 @@ extern struct cmd_map map_func_names[]; +static +void save_cmd(title, list, command, equals, fp) struct cmd_map *list; register char *command, *title; @@ -747,7 +753,7 @@ quote = "'"; (void) fprintf(fp, "%s %s%s%s", command, quote, - quoteit(ctrl_strcpy(buf, opts->m_str, TRUE), quote, TRUE), + quoteit(ctrl_strcpy(buf, opts->m_str, TRUE), (int)(*quote), TRUE), quote); if (equals && map_func_names[opts->m_cmd].m_str) (void) fprintf(fp, " %s", map_func_names[opts->m_cmd].m_str); @@ -758,7 +764,7 @@ quote = "'"; (void) fprintf(fp, " %s%s%s", quote, - quoteit(ctrl_strcpy(buf, opts->x_str, TRUE), quote, TRUE), + quoteit(ctrl_strcpy(buf, opts->x_str, TRUE), (int)(*quote), TRUE), quote); } (void) fputc('\n', fp); diff -uN 7.2.6-b2/signals.c 7.2.6-b3/signals.c --- 7.2.6-b2/signals.c Sun Nov 17 17:20:52 1996 +++ 7.2.6-b3/signals.c Sun Nov 17 15:43:59 1996 @@ -118,8 +118,9 @@ #ifdef SIGCONT #ifdef SIGTTOU -jmp_buf ttoubuf; +static jmp_buf ttoubuf; +static SIGRET tostop(sig) { @@ -400,7 +401,7 @@ last_msg_cnt = msg_cnt; else while (last_msg_cnt < msg_cnt) { char *p2 = compose_hdr(last_msg_cnt++) + 9; - if (strlen(p2) + (p - buf) >= BUFSIZ-5) { + if ((strlen(p2) + (p - buf)) >= (unsigned int)(BUFSIZ-5)) { (void) strcpy(p, "...\n"); /* force a break by setting last_msg_cnt correctly */ last_msg_cnt = msg_cnt; diff -uN 7.2.6-b2/sort.c 7.2.6-b3/sort.c --- 7.2.6-b2/sort.c Sun Nov 17 17:20:51 1996 +++ 7.2.6-b3/sort.c Sun Nov 17 15:43:59 1996 @@ -1,6 +1,9 @@ /* sort.c 3.0 (c) copyright 1986,1990 (Dan Heller) */ #include "mush.h" + +static pri_cmp(); + /* #define MYQSORT */ /* The size of this array should really be bounded by @@ -123,6 +126,7 @@ } #endif /* MYSORT */ +static status_cmp(msg1, msg2) register struct msg *msg1, *msg2; { @@ -164,6 +168,7 @@ return pri_cmp(msg1, msg2); } +static author_cmp(msg1, msg2) register struct msg *msg1, *msg2; { @@ -181,12 +186,13 @@ } /* compare messages according to size (length) */ +static size_cmp(msg1, msg2) register struct msg *msg1, *msg2; { int retval; - Debug("sizes: (%d): %d, (%d): %d\"\n", + Debug("sizes: (%d): %ld, (%d): %ld\"\n", msg1-msg, msg1->m_size, msg2-msg, msg2->m_size); if (retval = (msg1->m_size - msg2->m_size) * order) /* assign and test */ return retval; @@ -197,6 +203,7 @@ * Subject comparison ignoring Re: subject_to() appends an Re: if there is * any subject whatsoever. */ +static subject_cmp(msg1, msg2) register struct msg *msg1, *msg2; { @@ -230,6 +237,7 @@ * compare subject strings from two messages. * If Re is appended, so be it -- if user wants to ignore Re: use 'R' flag. */ +static subj_with_re(msg1, msg2) register struct msg *msg1, *msg2; { @@ -254,6 +262,7 @@ /* * compare addressee strings from two messages. */ +static addressee_cmp(msg1, msg2) register struct msg *msg1, *msg2; { @@ -275,6 +284,7 @@ return retval ? retval : msg_cmp(msg1, msg2); } +static date_cmp(msg1, msg2) register struct msg *msg1, *msg2; { @@ -290,6 +300,7 @@ return tm1 < tm2 ? -order : (tm1 > tm2) ? order : msg_cmp(msg1, msg2); } +static pri_cmp(msg1, msg2) register struct msg *msg1, *msg2; { diff -uN 7.2.6-b2/viewopts.c 7.2.6-b3/viewopts.c --- 7.2.6-b2/viewopts.c Sun Nov 17 17:20:51 1996 +++ 7.2.6-b3/viewopts.c Sun Nov 17 15:43:59 1996 @@ -30,7 +30,7 @@ * and to print TRUE/FALSE telling whether the value is on or off regardless * of it's "string" value. */ -struct viewopts viewopts[] = { +static struct viewopts viewopts[] = { { "alwaysignore", NULL, "Always ignore the message headers on the 'ignored' list." }, { "ask", NULL, diff -uN 7.2.6-b2/xcreat.c 7.2.6-b3/xcreat.c --- 7.2.6-b2/xcreat.c Sun Nov 17 17:20:51 1996 +++ 7.2.6-b3/xcreat.c Sun Nov 17 15:43:59 1996 @@ -79,6 +79,7 @@ /* Generate an almost-unique 4-character string from an unsigned long */ static +void ultoan(val, dest) unsigned long val; char *dest; /* convert to a number */ @@ -99,6 +100,7 @@ } while (val >>= 6); *dest = '\0'; + return; } /* create unique file name */