home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-07-06 | 56.0 KB | 1,801 lines |
- *** OLD/Makefile Fri Jun 10 12:38:05 1988
- --- Makefile Thu Jun 30 13:05:31 1988
- ***************
- *** 7,13 ****
- OBJS= main.o init.o misc.o mail.o hdrs.o execute.o commands.o print.o file.o \
- signals.o aliases.o setopts.o msgs.o pick.o sort.o expr.o strings.o \
- folders.o dates.o loop.o help.o viewopts.o curses.o curs_io.o bind.o
- ! HELP_FILES= README-6.0 README cmd_help mush.1
- MAKES= makefile.bsd makefile.x286 makefile.x386 makefile.sys.v
-
- CFLAGS= -O -DCURSES -DBSD
- --- 7,13 ----
- OBJS= main.o init.o misc.o mail.o hdrs.o execute.o commands.o print.o file.o \
- signals.o aliases.o setopts.o msgs.o pick.o sort.o expr.o strings.o \
- folders.o dates.o loop.o help.o viewopts.o curses.o curs_io.o bind.o
- ! HELP_FILES= README-6.0 README cmd_help mush.1 Mailrc
- MAKES= makefile.bsd makefile.x286 makefile.x386 makefile.sys.v
-
- CFLAGS= -O -DCURSES -DBSD
- *** OLD/README Fri Jun 10 12:38:05 1988
- --- README Tue Jun 28 21:37:48 1988
- ***************
- *** 9,22 ****
-
- When sending mail, mail to the addresses in the order given.
-
- ! Contained is the source for "Mail User's Shell" (MUSH), an interface
- ! for the sending, viewing and managing of electronic mail on UNIX(tm) systems.
- Redistribution of this 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. Failing to adhere to this reflects on your poor
- ! sense of fair play and bad attitude -- you will probably fail in your
- ! social and business affairs with little honor and respect from your peers.
-
- With that out of the way...
-
- --- 9,28 ----
-
- When sending mail, mail to the addresses in the order given.
-
- ! Mush is a Mail User Agent (MUA). That is, it is used by the user to read mail,
- ! arrange it, delete it, or act as an interface to send mail to other users.
- ! A Mail Transport Agent (MTA) is the program that mush talks to. The MTA
- ! actually delivers the mail to the destination (usually in the asynchronously
- ! with mush).
- !
- ! Contained is the source for "Mail User's Shell" (MUSH), an MUA that is
- ! designed to manage electronic mail on most UNIX(tm) systems.
- Redistribution of this 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 will extract the release version
- ! from the message headers of mush-originated messages to aid in implementing
- ! features and providing backwards complatibility with previous versions.
-
- With that out of the way...
-
- ***************
- *** 24,30 ****
- "config.h" (probably "config.h-dist") COPY it to config.h, edit it to reflect
- the system dependencines described there. Decide which makefile applies
- to you. makefile.sun applies only to suns and creates a binary called
- ! "mush." If the binary ends in "tool", then the graphics (tool) mode will
- be used by default on invocation. Otherwise, you must specify -t for toolmode
- on sun workstations. The SUNTOOL define must be set in the makefile.sun
- in order to compile the suntools version. You don't need to be running
- --- 30,36 ----
- "config.h" (probably "config.h-dist") COPY it to config.h, edit it to reflect
- the system dependencines described there. Decide which makefile applies
- to you. makefile.sun applies only to suns and creates a binary called
- ! "mush." If the binary ends in "tool", then the graphics (suntools) mode will
- be used by default on invocation. Otherwise, you must specify -t for toolmode
- on sun workstations. The SUNTOOL define must be set in the makefile.sun
- in order to compile the suntools version. You don't need to be running
- ***************
- *** 36,42 ****
- files not be compiled so the binary will be made smaller.
-
- The files makefile.x286 and makefile.x386 were created especially for
- ! xenix machines. Depending on the configuration of your particular xenix box,
- some tweeking of the makefile flags may be necessary. If your xenix
- release is 2.2 or higher then you must define USG. Libraries to use should
- be -ltinfo *not* -lcurses -ltermlib. This is because the curses package
- --- 42,48 ----
- files not be compiled so the binary will be made smaller.
-
- The files makefile.x286 and makefile.x386 were created especially for
- ! XENIX machines. Depending on the configuration of your particular xenix box,
- some tweeking of the makefile flags may be necessary. If your xenix
- release is 2.2 or higher then you must define USG. Libraries to use should
- be -ltinfo *not* -lcurses -ltermlib. This is because the curses package
- ***************
- *** 48,58 ****
- BSD and probably running a system-v flavor of unix -- this defines USG
- so that termio will be used. Some older unix systems have SYSV defined
- in /usr/include/curses.h (which is used if you are compiling with CURSES)
- ! In most cases, these only generate annoying warning messages and does not
- ! effect the compilation of the code.
-
- ! Mush was designed to use sendmail as the Mail Transport Agent. However,
- ! other MTA's will work. The MTA you use should be defined in config.h
- under the MAIL_DELIVERY macro define. By default, /usr/lib/sendmail -i
- is used -- the option, -i, tells sendmail not to accept "." on a line
- by itself as an end-of-file marker.
- --- 54,81 ----
- BSD and probably running a system-v flavor of unix -- this defines USG
- so that termio will be used. Some older unix systems have SYSV defined
- in /usr/include/curses.h (which is used if you are compiling with CURSES)
- ! In most cases, these may generate annoying warning messages but do not
- ! affect the compilation of the code.
-
- ! When you decide on an appropriate makefile, _copy_ it to a new file called
- ! Makefile.
- !
- ! When it comes to "compile-time definitions", you may use one of two methods:
- ! -DDEFINITION /* in your makefile */
- ! #define DEFINITION /* in the config.h file */
- ! If the definition is of the form MACRO="string", then use:
- ! -DMACRO=string
- ! #define MACRO string
- ! For example, if you are on a system V machine, you may need to define
- ! SIGRET to be of type void because the signal() function doesn't return
- ! anything useful (or, a "void" type). To define this, your makefile may
- ! have (as part of the CFLAGS setting):
- ! -DSIGRET=void
- ! or your config.h file should have somewhere in it (doesn't matter where):
- ! #define SIGRET void
- !
- ! Mush was originally designed to use sendmail as the Mail Transport Agent.
- ! However, other MTA's will work. The MTA you use should be defined in config.h
- under the MAIL_DELIVERY macro define. By default, /usr/lib/sendmail -i
- is used -- the option, -i, tells sendmail not to accept "." on a line
- by itself as an end-of-file marker.
- ***************
- *** 84,92 ****
- Some MTA's, especially older ones like /bin/mail or execmail (xenix), do
- not conform to RFC822 and provide the required headers: From: and Date:.
- To remedy either #define OLD_MAILER in config.h or add the -D option
- ! OLD_MAILER in the appropriate makefile: -DOLD_MAILER as part of the CFLAGS
- ! variable.
-
- If your mailer does NOT have a verbose option, then you should not have
- VERBOSE_ARG defined. Otherwise, define it to be whatever the
- verbose argument is for your mailer.
- --- 107,125 ----
- Some MTA's, especially older ones like /bin/mail or execmail (xenix), do
- not conform to RFC822 and provide the required headers: From: and Date:.
- To remedy either #define OLD_MAILER in config.h or add the -D option
- ! OLD_MAILER in the appropriate makefile: -DOLD_MAILER
-
- + If your machine talks to other computers via uucp _and_ you have the
- + macro OLD_MAILER defined, then you may want to define UUCP. This will
- + change the From: line to have your return address look like "host!user"
- + rather than "user@host" (which is the default).
- +
- + If your mailer does *NOT* like commas between addresses (smail, xenix and
- + xenix machines), then you should define NO_COMMAS.
- +
- + If your signal() returns void, SIGRET should be defined to be "void".
- + This mostly applies to SVR3. By default, SIGRET is defined to be "int".
- +
- If your mailer does NOT have a verbose option, then you should not have
- VERBOSE_ARG defined. Otherwise, define it to be whatever the
- verbose argument is for your mailer.
- ***************
- *** 151,165 ****
-
- Maintenance:
-
- ! If you want to use dbx or any other debugger, the undocumented flag, -e
- ! should be used as command line argument when you run the binary under
- ! the debugger. What this flag does is prevents your echo from being
- ! turned off and leaving cbreak on, thus, keeping your tty in a sane state.
- ! Beware of curses mode tho, since it must be turned off for that -- e.g.
- ! the -e flag is overridden if you enter curses mode. The -e flag can be
- ! used in general usage anyway, but there's no difference known to the user
- ! except for the fact that you can not type control characters.
- !
- If you have memory allocation checking and validation (sun 3.0+ ?) then
- define M_DEBUG in the makefile (main.c) and add the library
- /usr/lib/debug/malloc.o to the library list. Do this only if you are
- --- 184,198 ----
-
- Maintenance:
-
- ! If you want to use dbx or any other debugger, or to use your default tty
- ! driver, -e may be used as command line argument when you run the program.
- ! What this flag does is prevents your echo from being turned off and leaving
- ! cbreak off, thus, keeping your tty in a sane state.
- ! Beware of curses mode tho, since it will be automatically turned off for
- ! that mode. The -e flag is discouraged for future use (when automatic
- ! filename completion is introduced in the next version and other keyboard
- ! accelerators are introduced).
- !
- If you have memory allocation checking and validation (sun 3.0+ ?) then
- define M_DEBUG in the makefile (main.c) and add the library
- /usr/lib/debug/malloc.o to the library list. Do this only if you are
- ***************
- *** 169,174 ****
- --- 202,211 ----
- the sunwindows program will get a SIGXCPU (cpu time limit exceeded)
- because of the large amount of opening and closing large pixrects and
- devices. For this reason, SIGXPCPU is is caught in main.c.
- +
- + The "warning" variable may be set (at runtime in your .mushrc or as
- + a command: "set warning") to aid in finding runtime errors that aren't
- + fatal.
-
- If you ever get "Message N has bad date: <date string>" then note
- the FORMAT of that date and edit dates.c. There are a number of
- *** OLD/bind.c Fri Jun 10 12:38:06 1988
- --- bind.c Tue Jun 28 21:37:49 1988
- ***************
- *** 185,191 ****
- {
- char buf[MAX_BIND_LEN], buf2[256];
- register int x;
- ! int (*oldint)(), (*oldquit)();
- int unbind = (argv && **argv == 'u');
- int ret = -1; /* return value */
-
- --- 185,191 ----
- {
- char buf[MAX_BIND_LEN], buf2[256];
- register int x;
- ! SIGRET (*oldint)(), (*oldquit)();
- int unbind = (argv && **argv == 'u');
- int ret = -1; /* return value */
-
- *** OLD/bindings.h Fri Jun 10 12:38:06 1988
- --- bindings.h Tue Jun 28 21:37:49 1988
- ***************
- *** 6,11 ****
- --- 6,14 ----
- #define A_PREFIX_B 2
- #define B_PREFIX_A 3
-
- + #ifdef NULL_MAP
- + #undef NULL_MAP
- + #endif /* NULL_MAP */
- #define NULL_MAP (struct cmd_map *)0
- #define C_NULL 0
- #define C_GOTO_MSG 1
- *** OLD/cmd_help Thu May 12 21:14:24 1988
- --- cmd_help Tue Jun 28 21:37:51 1988
- ***************
- *** 162,168 ****
-
- %sort_help%
- usage: sort [-] [d | a | s | S | R]
- ! d sort according to date received
- a author (alphabetical)
- s subject ignoring Re: as part of the subject
- R subject (alphabetical)
- --- 162,168 ----
-
- %sort_help%
- usage: sort [-] [d | a | s | S | R]
- ! d sort according to date
- a author (alphabetical)
- s subject ignoring Re: as part of the subject
- R subject (alphabetical)
- ***************
- *** 170,176 ****
- The optional `-' flag will reverse the order of sorting
- By default (no arguments), sort sorts messages by status:
- New, unread messages are first, followed by preserved messages
- ! and finally the deleted messages are placed at the end
- %%
-
- %pick%
- --- 170,180 ----
- The optional `-' flag will reverse the order of sorting
- By default (no arguments), sort sorts messages by status:
- New, unread messages are first, followed by preserved messages
- ! and finally the deleted messages are placed at the end.
- !
- ! If "date_received" is set, sorting by date is sorted by
- ! the date you received the message. Otherwise, messages
- ! are sorted by date sent by the original author.
- %%
-
- %pick%
- ***************
- *** 280,303 ****
-
- %headers%
- usage: headers [+ | - | N] [-H:c]
- ! print out a screenful of headers.
- ! + print the next screenful.
- ! - print the previous screenful.
- ! N (where N is a number) print a screenful starting at N.
- ! set show_deleted to list deleted messages.
- ! cmd h headers look like UCB-Mail
- ! cmd H Headers show deleted messages (or set show_deleted)
- ! cmd z headers + `z' is next screenful
-
- ! Arguments to the headers command include -H:c where `c' is one of
- ! n just print messages headers of NEW messages
- d deleted messages
- u unread messages
- o old messages
- ! r messages that have been replied to
- a all messages (mostly for the command line argument -H:c)
- !
- ! piping to headers will print the headers of the "output" messages.
- %%
-
- %hdr_format%
- --- 284,308 ----
-
- %headers%
- usage: headers [+ | - | N] [-H:c]
- ! print out a screenful of headers.
-
- ! Arguments include:
- ! + print the next screenful (or use the 'z' command).
- ! - print the previous screenful (or use 'z-' ).
- ! N print a screenful starting at message number N.
- !
- ! "set show_deleted" to list deleted messages.
- !
- ! headers -H:c where `c' is one of
- ! n new messages
- d deleted messages
- u unread messages
- o old messages
- ! r replied-to messages
- ! s saved messages
- ! p preserved messages
- a all messages (mostly for the command line argument -H:c)
- ! The command, ":r" is equivalent to "headers -H:r"
- %%
-
- %hdr_format%
- *** OLD/commands.c Thu May 12 21:14:26 1988
- --- commands.c Tue Jul 5 12:08:11 1988
- ***************
- *** 107,113 ****
- }
- if (x)
- if (!strcmp(p, "top"))
- ! turnon(flg, TOP);
- else if (*p == '+') {
- turnon(flg, NO_PAGE);
- turnon(flg, NO_HEADER);
- --- 107,113 ----
- }
- if (x)
- if (!strcmp(p, "top"))
- ! turnon(flg, M_TOP);
- else if (*p == '+') {
- turnon(flg, NO_PAGE);
- turnon(flg, NO_HEADER);
- ***************
- *** 124,130 ****
- isoff(msg[current_msg].m_flags, UNREAD))
- current_msg++;
- if (p && (*p == '-' || !strcmp(p, "previous"))) {
- ! while (--current_msg >= 0 && ison(msg[current_msg].m_flags, DELETE))
- ;
- if (current_msg < 0) {
- print("No previous message.\n");
- --- 124,132 ----
- isoff(msg[current_msg].m_flags, UNREAD))
- current_msg++;
- if (p && (*p == '-' || !strcmp(p, "previous"))) {
- ! while (--current_msg >= 0 &&
- ! (ison(msg[current_msg].m_flags, DELETE) ||
- ! ison(msg[current_msg].m_flags, SAVED)))
- ;
- if (current_msg < 0) {
- print("No previous message.\n");
- ***************
- *** 141,147 ****
- /* "type" or "print" prints the current only -- "next" goes on.. */
- if (!p || !*p || *p == 'n')
- while (current_msg < msg_cnt &&
- ! ison(msg[current_msg].m_flags, DELETE))
- current_msg++;
- if (current_msg >= msg_cnt) {
- print("No more messages.\n");
- --- 143,150 ----
- /* "type" or "print" prints the current only -- "next" goes on.. */
- if (!p || !*p || *p == 'n')
- while (current_msg < msg_cnt &&
- ! (ison(msg[current_msg].m_flags, DELETE) ||
- ! ison(msg[current_msg].m_flags, SAVED)))
- current_msg++;
- if (current_msg >= msg_cnt) {
- print("No more messages.\n");
- ***************
- *** 207,213 ****
- register FILE *pp;
- register long flags = 0;
- char print_cmd[128], *printer, c, *cmd;
- ! int total = 0, (*oldint)(), (*oldquit)();
-
- turnon(flags, NO_IGNORE);
- if (!(printer = do_set(set_options, "printer")) || !*printer)
- --- 210,217 ----
- register FILE *pp;
- register long flags = 0;
- char print_cmd[128], *printer, c, *cmd;
- ! int total = 0;
- ! SIGRET (*oldint)(), (*oldquit)();
-
- turnon(flags, NO_IGNORE);
- if (!(printer = do_set(set_options, "printer")) || !*printer)
- ***************
- *** 319,345 ****
- turnon(flg, NO_HEADER);
- else
- turnon(flg, UPDATE_STATUS);
- - if (do_set(set_options, "keepsave"))
- - firstchar = 'c';
- for (n = msg_number = 0; msg_number < msg_cnt; msg_number++)
- if (msg_bit(list, msg_number)) {
- print("%sing msg %d... ",
- (firstchar == 's')? "Sav" : "Writ", msg_number+1);
- print_more("(%d lines)\n", copy_msg(msg_number, mail_fp, flg));
- - /* only mark "deleted" if mailfile is /usr/spool/mail and
- - * we're not "copying. If keepsave is set, then firstchar
- - * will have already been changed to 'c'
- - */
- - if (!strcmp(mailfile, spoolfile) && firstchar != 'c' &&
- - isoff(glob_flags, READ_ONLY))
- - turnon(msg[msg_number].m_flags, DELETE);
- n++;
- }
- fclose(mail_fp);
- print_more("%s %d msg%s to %s\n",
- (*mode == 'a')? "Appended" : "Saved", n, (n != 1)? "s": "", file);
- - if (!strcmp(mailfile, spoolfile))
- - turnon(glob_flags, DO_UPDATE);
- #ifdef SUNTOOL
- if (istool) {
- unlock_cursors();
- --- 323,342 ----
- turnon(flg, NO_HEADER);
- else
- turnon(flg, UPDATE_STATUS);
- for (n = msg_number = 0; msg_number < msg_cnt; msg_number++)
- if (msg_bit(list, msg_number)) {
- print("%sing msg %d... ",
- (firstchar == 's')? "Sav" : "Writ", msg_number+1);
- print_more("(%d lines)\n", copy_msg(msg_number, mail_fp, flg));
- n++;
- + if (isoff(msg[msg_number].m_flags, SAVED) && firstchar != 'c') {
- + turnon(glob_flags, DO_UPDATE);
- + turnon(msg[msg_number].m_flags, SAVED);
- + }
- }
- fclose(mail_fp);
- print_more("%s %d msg%s to %s\n",
- (*mode == 'a')? "Appended" : "Saved", n, (n != 1)? "s": "", file);
- #ifdef SUNTOOL
- if (istool) {
- unlock_cursors();
- ***************
- *** 414,420 ****
- do {
- if (cdpath) {
- char c;
- ! if (p2 = any(cdpath, " \t"))
- c = *p2, *p2 = 0;
- (void) sprintf(buf, "%s/%s", cdpath, p);
- if (cdpath = p2) /* assign and compare to NULL */
- --- 411,417 ----
- do {
- if (cdpath) {
- char c;
- ! if (p2 = any(cdpath, " \t:"))
- c = *p2, *p2 = 0;
- (void) sprintf(buf, "%s/%s", cdpath, p);
- if (cdpath = p2) /* assign and compare to NULL */
- ***************
- *** 514,520 ****
- /* goto next available message if current was just deleted.
- * If there are no more messages, turnoff prnt_next.
- */
- ! if (!iscurses && !undel && ison(msg[current_msg].m_flags, DELETE))
- next_msg();
-
- if (prnt_next && !undel && !iscurses)
- --- 511,519 ----
- /* goto next available message if current was just deleted.
- * If there are no more messages, turnoff prnt_next.
- */
- ! if (!iscurses && !undel &&
- ! ison(msg[current_msg].m_flags, DELETE) ||
- ! ison(msg[current_msg].m_flags, SAVED))
- next_msg();
-
- if (prnt_next && !undel && !iscurses)
- ***************
- *** 602,612 ****
- error(buf);
- return -1;
- }
- ! turnon(glob_flags, IGN_SIGS);
- ! while (fgets(buf, 127, pp))
- ! wprint(buf);
- (void) pclose(pp);
- ! turnoff(glob_flags, IGN_SIGS);
- return 0;
- }
-
- --- 601,611 ----
- error(buf);
- return -1;
- }
- ! (void) do_pager(NULL, TRUE);
- ! while (fgets(buf, 127, pp) && do_pager(buf, FALSE) != EOF)
- ! ;
- (void) pclose(pp);
- ! (void) do_pager(NULL, FALSE);
- return 0;
- }
-
- *** OLD/curs_io.c Fri Jun 10 12:38:09 1988
- --- curs_io.c Tue Jun 28 21:37:56 1988
- ***************
- *** 54,59 ****
- --- 54,61 ----
- register int c, literal_next = FALSE;
- int count = offset;
-
- + fflush(stdout); /* make sure everything is flushed before getting input */
- +
- while ((c = getchar()) != '\n' && c != '\r' && c != EOF &&
- isoff(glob_flags, WAS_INTR)) {
- /* echo isn't set, so whatever the character, enter it */
- *** OLD/curses.c Thu May 12 21:14:28 1988
- --- curses.c Tue Jun 28 21:37:59 1988
- ***************
- *** 341,347 ****
- (c == C_DELETE_MSG || c == C_DELETE_LIST)? "":"un", list);
- putchar('\n');
- }
- ! if (ison(msg[current_msg].m_flags, DELETE))
- (void) next_msg();
- if (isoff(msg[current_msg].m_flags, DELETE) &&
- do_set(set_options, "autoprint"))
- --- 341,348 ----
- (c == C_DELETE_MSG || c == C_DELETE_LIST)? "":"un", list);
- putchar('\n');
- }
- ! if (ison(msg[current_msg].m_flags, DELETE) ||
- ! ison(msg[current_msg].m_flags, SAVED))
- (void) next_msg();
- if (isoff(msg[current_msg].m_flags, DELETE) &&
- do_set(set_options, "autoprint"))
- ***************
- *** 471,477 ****
- /* change to a new folder */
- when C_FOLDER :
- for (;;) {
- ! int (*oldint)(), (*oldquit)();
- on_intr();
- print("New folder (?=list): ");
- c = Getstr(file, COLS-22, 0);
- --- 472,478 ----
- /* change to a new folder */
- when C_FOLDER :
- for (;;) {
- ! SIGRET (*oldint)(), (*oldquit)();
- on_intr();
- print("New folder (?=list): ");
- c = Getstr(file, COLS-22, 0);
- ***************
- *** 718,724 ****
- int n;
-
- for (n = 0; n < COLS; n++)
- ! if ((buf = mvinch(line, n) & A_CHARTEXT) == '\0')
- break;
- buf[n] = '\0';
- #endif /* A_CHARTEXT */
- --- 719,725 ----
- int n;
-
- for (n = 0; n < COLS; n++)
- ! if ((buf[n] = (mvinch(line, n) & A_CHARTEXT)) == '\0')
- break;
- buf[n] = '\0';
- #endif /* A_CHARTEXT */
- *** OLD/dates.c Wed Mar 9 12:26:28 1988
- --- dates.c Tue Jun 28 21:37:59 1988
- ***************
- *** 80,92 ****
- */
-
- /* else, get the "date" line, if that fails, get the date in "From" line */
- ! if ((p = header_field(n, "date")) && (p2 = parse_date(p)))
- return p2;
-
- ! (void) fseek(tmpf, msg[n].m_offset, L_SET);
- ! (void) fgets(line, BUFSIZ, tmpf);
- ! if (!(p = index(line, ' ')) || !(p2 = index(p+1, ' ')))
- return NULL;
- p = p2;
-
- if (!(p2 = parse_date(p)))
- --- 80,97 ----
- */
-
- /* else, get the "date" line, if that fails, get the date in "From" line */
- ! if (
- ! #ifndef MSG_SEPARATOR
- ! isoff(glob_flags, DATE_RECV) &&
- ! #endif /* MSG_SEPARATOR */
- ! (p = header_field(n, "date")) && (p2 = parse_date(p)))
- return p2;
-
- ! #ifndef MSG_SEPARATOR
- ! if (fseek(tmpf, msg[n].m_offset, L_SET) == -1 || !fgets(line, BUFSIZ, tmpf)
- ! || !(p = index(line, ' ')) || !(p2 = index(p+1, ' ')))
- return NULL;
- + #endif /* MSG_SEPARATOR */
- p = p2;
-
- if (!(p2 = parse_date(p)))
- *** OLD/doproc.c Sat Apr 2 16:13:34 1988
- --- doproc.c Tue Jun 28 21:38:00 1988
- ***************
- *** 192,198 ****
- print("Type in Main Panel Window a filename to save message");
- return;
- }
- ! else if (value <= 1) {
- register char *p = panel_get_value(file_item);
- register char *p2 = panel_get_value(msg_num_item);
- if ((!p || !*p) && (!(p = do_set(set_options, "mbox")) || !*p))
- --- 192,198 ----
- print("Type in Main Panel Window a filename to save message");
- return;
- }
- ! else if (value == 0) {
- register char *p = panel_get_value(file_item);
- register char *p2 = panel_get_value(msg_num_item);
- if ((!p || !*p) && (!(p = do_set(set_options, "mbox")) || !*p))
- *** OLD/execute.c Fri Jun 10 12:38:11 1988
- --- execute.c Tue Jun 28 21:38:01 1988
- ***************
- *** 22,30 ****
- union wait status;
- #endif /* SYSV */
- #ifdef SIGCONT
- ! int (*oldstop)(), (*oldcont)();
- #endif /* SIGCONT */
- ! int pid, (*oldint)(), (*oldquit)();
-
- #ifdef SUNTOOL
- if (istool) {
- --- 22,31 ----
- union wait status;
- #endif /* SYSV */
- #ifdef SIGCONT
- ! SIGRET (*oldstop)(), (*oldcont)();
- #endif /* SIGCONT */
- ! int pid;
- ! SIGRET (*oldint)(), (*oldquit)();
-
- #ifdef SUNTOOL
- if (istool) {
- ***************
- *** 81,86 ****
- --- 82,88 ----
- turnoff(glob_flags, IGN_SIGS);
- }
-
- + SIGRET
- sigchldcatcher()
- {
- #ifdef SUNTOOL
- *** OLD/hdrs.c Thu Apr 28 22:48:02 1988
- --- hdrs.c Tue Jul 5 12:46:40 1988
- ***************
- *** 51,57 ****
- register char **argv, list[];
- {
- register int pageful = 0, fnd;
- ! int (*oldint)(), (*oldquit)(), show_deleted;
- static int cnt;
- register char *p;
- char first_char = (argc) ? **argv: 'h';
- --- 51,58 ----
- register char **argv, list[];
- {
- register int pageful = 0, fnd;
- ! SIGRET (*oldint)(), (*oldquit)();
- ! int show_deleted;
- static int cnt;
- register char *p;
- char first_char = (argc) ? **argv: 'h';
- ***************
- *** 191,197 ****
- when 'o': special = OLD;
- when 'd': special = DELETE;
- when 'r': special = REPLIED;
- ! otherwise: print("choose from n,u,o,d,r, or a"); return -1;
- }
- if (debug)
- (void) check_flags(special);
- --- 192,200 ----
- when 'o': special = OLD;
- when 'd': special = DELETE;
- when 'r': special = REPLIED;
- ! when 's': special = SAVED;
- ! when 'p': special = PRESERVE;
- ! otherwise: print("choose from n,u,o,d,r,s,p or a"); return -1;
- }
- if (debug)
- (void) check_flags(special);
- ***************
- *** 249,267 ****
- char *
- compose_hdr(cnt)
- {
- ! static char buf[256];
- ! register char *p, *b;
- ! char from[256], subject[256], date[17], lines[16], chars[16], line[256];
- char to[256], addr[256], name[256], status[2];
- ! char Day[3], Mon[4], Tm[8], Yr[5], Wkday[4], *date_p;
-
- /* status of the message */
- if (ison(msg[cnt].m_flags, DELETE))
- status[0] = '*';
- - else if (ison(msg[cnt].m_flags, OLD) && ison(msg[cnt].m_flags, UNREAD))
- - status[0] = 'U';
- else if (ison(msg[cnt].m_flags, PRESERVE))
- status[0] = 'P';
- else if (isoff(msg[cnt].m_flags, UNREAD))
- status[0] = ' ';
- else
- --- 252,273 ----
- char *
- compose_hdr(cnt)
- {
- ! static char buf[256];
- ! register char *p, *p2, *b;
- ! int len, do_pad = FALSE, val, pad, got_dot, isauthor = 0;
- ! char from[256], subject[256], date[17], lines[16], chars[16];
- char to[256], addr[256], name[256], status[2];
- ! char Day[3], Mon[4], Tm[8], Yr[5], Wkday[4], *date_p, *p3;
-
- /* status of the message */
- if (ison(msg[cnt].m_flags, DELETE))
- status[0] = '*';
- else if (ison(msg[cnt].m_flags, PRESERVE))
- status[0] = 'P';
- + else if (ison(msg[cnt].m_flags, SAVED))
- + status[0] = 'S';
- + else if (ison(msg[cnt].m_flags, OLD) && ison(msg[cnt].m_flags, UNREAD))
- + status[0] = 'U';
- else if (isoff(msg[cnt].m_flags, UNREAD))
- status[0] = ' ';
- else
- ***************
- *** 273,279 ****
- status[1] = ' ';
-
- to[0] = from[0] = subject[0] = date[0] = lines[0] = chars[0] = addr[0] =
- ! name[0] = line[0] = Day[0] = Mon[0] = Tm[0] = Yr[0] = Wkday[0] = 0;
-
- /* who's the message to */
- if ((p = header_field(cnt, "to")) ||
- --- 279,285 ----
- status[1] = ' ';
-
- to[0] = from[0] = subject[0] = date[0] = lines[0] = chars[0] = addr[0] =
- ! name[0] = Day[0] = Mon[0] = Tm[0] = Yr[0] = Wkday[0] = 0;
-
- /* who's the message to */
- if ((p = header_field(cnt, "to")) ||
- ***************
- *** 281,306 ****
- (p = header_field(cnt, "apparently-to")))
- Strncpy(to, p);
-
- ! /* who the messages is from--
- ! * %f From field
- ! * %a From address
- ! * %n From name
- */
- if (!(p = header_field(cnt, "from"))) {
- ! /* if all else fails, then get the first token in "From" line */
- ! register char *p2;
- ! p = ""; /* just in case */
- ! if (fseek(tmpf, msg[cnt].m_offset, L_SET) == -1 ||
- ! !(p2 = fgets(line, sizeof(line), tmpf))) {
- ! error("fseek in %s (msg %d, folder=%s)", tempfile, cnt+1, mailfile);
- ! turnon(glob_flags, READ_ONLY);
- ! } else if (!(p = index(p2, ' ')))
- ! print("Fudged \"From\" line: %s", p2);
- ! else if (p2 = any(++p, " \t"))
- ! *p2 = 0;
- }
- ! skipspaces(0);
- ! (void) no_newln(p);
- /* if the "from" line produced the user's login name, then the message is
- * from the user -- attempt to give more useful information by telling
- * to whom the message was sent. This is not possible if the "to" header
- --- 287,321 ----
- (p = header_field(cnt, "apparently-to")))
- Strncpy(to, p);
-
- ! /*
- ! * Read the "From " line first. If it's from us, login's will match.
- ! * Also, we have the date received at our disposal.
- */
- + #ifndef MSG_SEPARATOR
- + p = ""; /* just in case */
- + if (fseek(tmpf, msg[cnt].m_offset, L_SET) == -1 ||
- + !(p2 = fgets(from, sizeof(from), tmpf))) {
- + error("fseek in %s (msg %d, folder=%s)", tempfile, cnt+1, mailfile);
- + turnon(glob_flags, READ_ONLY);
- + } else if (!(p = index(p2, ' ')))
- + print("Fudged \"From\" line: %s", p2);
- + else {
- + skipspaces(1);
- + if (p2 = any(p, " \t")) {
- + /* p now points to null terminated login name */
- + for (*p2++ = 0; isspace(*p2); p2++)
- + ; /* p2 points to date received */
- + Strncpy(buf, p2); /* buf is only used till "date" is filled */
- + p2 = buf;
- + }
- + }
- + #else
- if (!(p = header_field(cnt, "from"))) {
- ! wprint("Error in msg %d's format. No \"From:\" line.\n", cnt+1);
- ! return " "; /* Real bad news here.... */
- }
- ! #endif /* MSG_SEPARATOR */
- !
- /* if the "from" line produced the user's login name, then the message is
- * from the user -- attempt to give more useful information by telling
- * to whom the message was sent. This is not possible if the "to" header
- ***************
- *** 307,325 ****
- * failed to get info (which is probably impossible).
- */
- if (!strcmp(p, login) && *to) {
- ! (void) strcpy(from, "TO: ");
- ! (void) strncpy(from+4, to, sizeof(from)-4), from[sizeof(from)-4] = 0;
- ! (void) get_name_n_addr(from+4, name+4, addr+4);
- ! if (name[4])
- ! (void) strncpy(name,"TO: ",4); /* strncpy doesn't null terminate */
- if (addr[4])
- ! (void) strncpy(addr,"TO: ",4); /* don't overwrite name there */
- } else {
- ! Strncpy(from, p);
- (void) get_name_n_addr(from, name, addr);
- }
-
- ! if (date_p = msg_date(cnt))
- /* don't take weekday unless specified explicitly. See 'D' below */
- date_to_string(date_p, Yr, Mon, Day, NULL, Tm, date);
-
- --- 322,355 ----
- * failed to get info (which is probably impossible).
- */
- if (!strcmp(p, login) && *to) {
- ! isauthor = TRUE;
- ! (void) get_name_n_addr(to, name+4, addr+4);
- if (addr[4])
- ! (void) strncpy(addr, "TO: ", 4);
- ! if (name[4]) { /* check to see if a name got added */
- ! (void) strncpy(name, "TO: ", 4);
- ! Strncpy(from, name);
- ! } else
- ! Strncpy(from, addr);
- } else {
- ! #ifndef MSG_SEPARATOR
- ! if (p = header_field(cnt, "from"))
- ! #endif /* MSG_SEPARATOR */
- ! Strncpy(from, p);
- (void) get_name_n_addr(from, name, addr);
- }
-
- ! #ifndef MSG_SEPARATOR
- ! /* hackers note: p2 already points to a ctime(3) string with weekday
- ! * name and month and all that -- I'm inefficiently converting to
- ! * a different format just to be converted back again later. Change this.
- ! */
- ! if (ison(glob_flags, DATE_RECV))
- ! date_p = parse_date(p2);
- ! else
- ! #endif /* MSG_SEPARATOR */
- ! date_p = msg_date(cnt);
- ! if (date_p)
- /* don't take weekday unless specified explicitly. See 'D' below */
- date_to_string(date_p, Yr, Mon, Day, NULL, Tm, date);
-
- ***************
- *** 357,364 ****
- else if (*p == '%') {
- char fmt[64];
- register char *p2 = fmt;
- - int len, got_dot = FALSE;
-
- *p2++ = '%';
- if (p[1] != '-')
- *p2++ = '-';
- --- 387,395 ----
- else if (*p == '%') {
- char fmt[64];
- register char *p2 = fmt;
-
- + /* first check for string padding: %5n, %.4a, %10.5f, %-.3l etc. */
- + do_pad = pad = val = got_dot = 0;
- *p2++ = '%';
- if (p[1] != '-')
- *p2++ = '-';
- ***************
- *** 366,389 ****
- *++p;
- while (isdigit(*++p) || !got_dot && *p == '.') {
- if (*p == '.')
- ! got_dot = TRUE;
- *p2++ = *p;
- }
- if (!got_dot && isdigit(p[-1])) {
- - int val;
- *p2 = 0; /* assure null termination */
- val = atoi(fmt+1);
- ! p2 += strlen(sprintf(p2, ".%d", (val >= 0 ? val : -val)));
- }
- *p2++ = 's', *p2 = 0;
- switch (*p) {
- ! case 'f': p2 = from;
- when 'a':
- if (!*(p2 = addr))
- p2 = from;
- when 'n':
- if (!*(p2 = name))
- ! p2 = from;
- when '%': p2 = "%";
- when 't': p2 = to;
- when 's': p2 = subject;
- --- 397,425 ----
- *++p;
- while (isdigit(*++p) || !got_dot && *p == '.') {
- if (*p == '.')
- ! got_dot = TRUE, val = pad, pad = 0;
- ! else
- ! pad = pad * 10 + *p - '0';
- *p2++ = *p;
- }
- if (!got_dot && isdigit(p[-1])) {
- *p2 = 0; /* assure null termination */
- val = atoi(fmt+1);
- ! if (val < 0)
- ! val = -val;
- ! p2 += strlen(sprintf(p2, ".%d", val));
- }
- + pad = min(pad, val);
- *p2++ = 's', *p2 = 0;
- switch (*p) {
- ! case 'f': p2 = from, do_pad = TRUE;
- when 'a':
- if (!*(p2 = addr))
- p2 = from;
- + do_pad = TRUE;
- when 'n':
- if (!*(p2 = name))
- ! p2 = from, do_pad = TRUE;
- when '%': p2 = "%";
- when 't': p2 = to;
- when 's': p2 = subject;
- ***************
- *** 406,411 ****
- --- 442,465 ----
- }
- otherwise: continue; /* unknown formatting char */
- }
- + if (do_pad && pad && strlen(p2) > pad) {
- + char *old_p2 = p2;
- + /* if addr is too long, move pointer forward till the
- + * "important" part is readable only for ! paths/addresses.
- + */
- + while (p3 = index(p2, '!')) {
- + p2 = p3+1;
- + if (strlen(p2) + isauthor*4 < pad) {
- + if (isauthor && (p2 -= 4) < old_p2)
- + p2 = old_p2;
- + break;
- + }
- + }
- + if (isauthor && p2 > old_p2+4 && !p3 && strlen(p2) + 4 > pad)
- + p2 -= 4;
- + if (old_p2 != p2 && isauthor)
- + (void) strncpy(p2, "TO: ", 4); /* doesn't null terminate */
- + }
- len = strlen(sprintf(b, fmt, p2));
- cnt += len, b += len;
- /* Get around a bug in 5.5 IBM RT which pads with NULL's not ' ' */
- ***************
- *** 816,836 ****
- else if (*addr && Alts && *Alts && chk_two_lists(login,addr, "!@%=")) {
- /* To be in this block, there must be a remote address */
- i = 0; /* initialize 'i' in case while loop is skipped */
- - #ifndef SYSV
- /* see if the hostnames match our hostname. */
- while (i < MAX_HOST_NAMES && ourname[i])
- if (chk_two_lists(addr, ourname[i++], "!@%="))
- break;
- - #endif /* SYSV */
- /* If one of the hostnames in the address is one of user's
- * hostnames, remove this address. If the alternates
- * hostnames listed contains a hostname in the address, remove
- * from the list.
- */
- ! if (
- ! #ifndef SYSV
- ! i < MAX_HOST_NAMES && ourname[i] ||
- ! #endif /* SYSV */
- *Alts == '*' || !chk_two_lists(addr, Alts, "!@%= \t,"))
- rm_me = TRUE;
- }
- --- 870,885 ----
- else if (*addr && Alts && *Alts && chk_two_lists(login,addr, "!@%=")) {
- /* To be in this block, there must be a remote address */
- i = 0; /* initialize 'i' in case while loop is skipped */
- /* see if the hostnames match our hostname. */
- while (i < MAX_HOST_NAMES && ourname[i])
- if (chk_two_lists(addr, ourname[i++], "!@%="))
- break;
- /* If one of the hostnames in the address is one of user's
- * hostnames, remove this address. If the alternates
- * hostnames listed contains a hostname in the address, remove
- * from the list.
- */
- ! if (i < MAX_HOST_NAMES && ourname[i] ||
- *Alts == '*' || !chk_two_lists(addr, Alts, "!@%= \t,"))
- rm_me = TRUE;
- }
- *** OLD/init.c Thu Apr 7 22:46:51 1988
- --- init.c Tue Jun 28 21:38:07 1988
- ***************
- *** 101,113 ****
- #include <netdb.h>
- #endif /* BSD */
-
- void
- init()
- {
- ! char *home;
- extern char *getlogin();
- #ifdef SYSV
- extern struct passwd *getpwuid(); /* sys-v forgot this in pwd.h! */
- #else
- char ourhost[128];
- #endif /* SYSV */
- --- 101,119 ----
- #include <netdb.h>
- #endif /* BSD */
-
- + #ifdef SYSV
- + #include <sys/utsname.h>
- + #endif /* SYSV */
- +
- void
- init()
- {
- ! char *home, *realname;
- extern char *getlogin();
- + char buf[MAXPATHLEN];
- #ifdef SYSV
- extern struct passwd *getpwuid(); /* sys-v forgot this in pwd.h! */
- + struct utsname ourhost;
- #else
- char ourhost[128];
- #endif /* SYSV */
- ***************
- *** 118,124 ****
- struct hostent *hp;
- #endif /* BSD */
-
- ! home = getenv ("HOME");
-
- if (!(entry = getpwuid(getuid())))
- if (p = getlogin())
- --- 124,131 ----
- struct hostent *hp;
- #endif /* BSD */
-
- ! home = getenv("HOME");
- ! realname = getenv("NAME");
-
- if (!(entry = getpwuid(getuid())))
- if (p = getlogin())
- ***************
- *** 131,136 ****
- --- 138,147 ----
- strdup(login, entry->pw_name);
- if (!home || !*home)
- home = entry->pw_dir;
- + if (!realname && (realname = entry->pw_gecos)) {
- + if (p = index(realname, ','))
- + *p = 0;
- + }
- endpwent();
- }
- if (!home || !*home || Access(home, W_OK)) {
- ***************
- *** 139,154 ****
- else
- print("No home!? ");
- print_more("Using \"%s\" as home.\n", ALTERNATE_HOME);
- ! } else {
- ! char buf[MAXPATHLEN];
- ! cmd_line(sprintf(buf, "set home=\"%s\"", home), msg_list);
- ! }
- crt = 25;
- screen = 18;
- escape = DEF_ESCAPE;
- prompt = DEF_PROMPT;
-
- ! #ifndef SYSV
- (void) gethostname(ourhost, sizeof ourhost);
- if (!(hp = gethostbyname(ourhost)))
- error("gethostbyname: %s", ourhost);
- --- 150,165 ----
- else
- print("No home!? ");
- print_more("Using \"%s\" as home.\n", ALTERNATE_HOME);
- ! } else
- ! (void) cmd_line(sprintf(buf,"set home=\"%s\"", home), msg_list);
- ! if (realname)
- ! (void) cmd_line(sprintf(buf,"set realname=\"%s\"", realname), msg_list);
- crt = 25;
- screen = 18;
- escape = DEF_ESCAPE;
- prompt = DEF_PROMPT;
-
- ! #ifdef BSD
- (void) gethostname(ourhost, sizeof ourhost);
- if (!(hp = gethostbyname(ourhost)))
- error("gethostbyname: %s", ourhost);
- ***************
- *** 156,166 ****
- --- 167,185 ----
- p = hp->h_aliases[cnt++])
- ourname[cnt] = savestr(p);
- endhostent();
- + #endif /* BSD */
- + #ifdef SYSV
- + if (uname (&ourhost) >= 0)
- + ourname[0] = savestr(ourhost.nodename);
- #endif /* SYSV */
-
- #ifdef CURSES
- init_bindings();
- #endif /* CURSES */
- +
- + if (ourname[0])
- + (void) cmd_line(sprintf(buf,
- + "set hostname=\"%s\"", ourname[0]), msg_list);
- }
-
- /*
- ***************
- *** 274,299 ****
- goto bad;
- }
- /* "lhs" is the left hand side of the equation
- ! * In this instance, we're doing case 2 above.
- */
- if (*lhs == '!') {
- - int tmp = argc;
- equals = FALSE;
- ! if (!*++lhs)
- ! if (!(lhs = newargv[2])) {
- ! print("%s: %d: syntax error: \"if ! <what?>\"\n",
- ! file, line_no);
- ! goto bad;
- ! } else
- ! tmp--;
- ! if (tmp > 2) {
- ! print("%s: %d: syntax error: \"if !<expr> <more junk>\"\n",
- file, line_no);
- goto bad;
- }
- ! } else if (argc > 2) {
- if (argc != 4) {
- ! print("%s: %d: argument count error: line has %d args.\n",
- file, line_no, argc);
- goto bad;
- }
- --- 293,327 ----
- goto bad;
- }
- /* "lhs" is the left hand side of the equation
- ! * In this instance, we're doing case 2 above (check for negation).
- */
- if (*lhs == '!') {
- equals = FALSE;
- ! if (!*++lhs && !(lhs = newargv[2])) {
- ! print("%s: line %d: syntax error: \"if ! <what?>\"\n",
- file, line_no);
- goto bad;
- }
- ! }
- ! if (*lhs == '-' && (lhs[1] == 'e' || lhs[1] == 'z') && !lhs[2]) {
- ! char *path;
- ! int n = 1; /* ignore ENOENT, I'll handle it here */
- ! struct stat statb;
- !
- ! /* check for existence or zero-length folders/files */
- ! if (argc > 4) {
- ! print("%s: line %d: if %s \"filename\"\n",
- ! file, line_no, lhs);
- ! goto bad;
- ! }
- ! path = getpath(newargv[argc-1], &n);
- ! parsing = !equals ^ (n == -1 || n == 1 && lhs[1] == 'e' ||
- ! !stat(path, &statb) && (lhs[1] == 'e' || !statb.st_size));
- ! goto bad; /* it's not bad, but we're done anyway */
- ! }
- ! if (equals && argc > 2) {
- if (argc != 4) {
- ! print("%s: %d: argument count error: %d args.\n",
- file, line_no, argc);
- goto bad;
- }
- ***************
- *** 301,307 ****
- if (!strcmp(newargv[2], "!="))
- equals = FALSE;
- else if (strcmp(newargv[2], "==")) {
- ! print("%s: %d: use `==' or `!=' only.\n", file, line_no);
- goto bad;
- }
- rhs = newargv[3];
- --- 329,335 ----
- if (!strcmp(newargv[2], "!="))
- equals = FALSE;
- else if (strcmp(newargv[2], "==")) {
- ! print("%s: %d: use `==' or `!=' only.\n", file,line_no);
- goto bad;
- }
- rhs = newargv[3];
- *** OLD/loop.c Thu May 12 21:14:31 1988
- --- loop.c Tue Jun 28 21:38:08 1988
- ***************
- *** 58,64 ****
- SIG_DFL
- #endif /* SYSV */
- );
- - (void) signal(SIGPIPE, SIG_IGN); /* if pager is terminated before end */
-
- turnoff(glob_flags, IGN_SIGS);
- if (hist_size == 0) /* if user didn't set history in .rc file */
- --- 58,63 ----
- ***************
- *** 877,882 ****
- --- 876,886 ----
- register int list_num = TRUE, num_of_hists = hist_size;
- register int reverse = FALSE;
- struct history *hist = hist_tail;
- +
- + if (!hist) {
- + print("No history yet.\n");
- + return;
- + }
-
- while (*++argv && *argv[0] == '-') {
- n = 1;
- *** OLD/mail.c Mon Jun 13 15:38:27 1988
- --- mail.c Tue Jul 5 22:48:43 1988
- ***************
- *** 32,38 ****
- static char Subject[BUFSIZ],To[BUFSIZ],Cc[BUFSIZ],Bcc[BUFSIZ],in_reply_to[256];
- static int killme;
- static u_long flags;
- ! static int (*oldterm)(), (*oldint)(), (*oldquit)();
- static void send_it();
- static jmp_buf cntrl_c_buf;
- FILE *ed_fp;
- --- 32,38 ----
- static char Subject[BUFSIZ],To[BUFSIZ],Cc[BUFSIZ],Bcc[BUFSIZ],in_reply_to[256];
- static int killme;
- static u_long flags;
- ! static SIGRET (*oldterm)(), (*oldint)(), (*oldquit)();
- static void send_it();
- static jmp_buf cntrl_c_buf;
- FILE *ed_fp;
- ***************
- *** 155,161 ****
- turnoff(flgs, NEW_SUBJECT);
- if (subj = subject_to(current_msg, buf))
- subj = strcpy(Subject, buf + 4*(lower(firstchar) != 'r'));
- ! } else if (isoff(flgs, NEW_SUBJECT) && do_set(set_options, "ask"))
- turnon(flgs, NEW_SUBJECT);
- if (argv && *argv) {
- char buf[BUFSIZ];
- --- 155,162 ----
- turnoff(flgs, NEW_SUBJECT);
- if (subj = subject_to(current_msg, buf))
- subj = strcpy(Subject, buf + 4*(lower(firstchar) != 'r'));
- ! } else if (isoff(flgs, NEW_SUBJECT) &&
- ! (do_set(set_options, "ask") || do_set(set_options, "asksub")))
- turnon(flgs, NEW_SUBJECT);
- if (argv && *argv) {
- char buf[BUFSIZ];
- ***************
- *** 163,169 ****
- fix_up_addr(buf);
- to = &To[strlen(To)];
- if (*To)
- ! to += Strcpy(to-1, ", ") - 1;
- (void) strcpy(to, buf);
- to = To;
- }
- --- 164,170 ----
- fix_up_addr(buf);
- to = &To[strlen(To)];
- if (*To)
- ! *to++ = ',', *to++ = ' ';
- (void) strcpy(to, buf);
- to = To;
- }
- ***************
- *** 410,416 ****
- */
- (void) setjmp(cntrl_c_buf);
- while (Getstr(line, sizeof(line), 0) > -1) {
- ! (void) check_new_mail(); /* if new mail comes in, get it */
- if ((i = add_to_letter(line)) <= 0)
- break;
- }
- --- 411,418 ----
- */
- (void) setjmp(cntrl_c_buf);
- while (Getstr(line, sizeof(line), 0) > -1) {
- ! if (!istool) /* toolmode checks on a timer -- don't do it here */
- ! (void) check_new_mail(); /* if new mail comes in, get it */
- if ((i = add_to_letter(line)) <= 0)
- break;
- }
- ***************
- *** 564,570 ****
- if (!(p2 = do_set(set_options, p)))
- wprint("(%s isn't set)\n", p);
- else
- ! fprintf(ed_fp, "%s\n", p2);
- }
- when ':': {
- char new[MAXMSGS_BITS];
- --- 566,572 ----
- if (!(p2 = do_set(set_options, p)))
- wprint("(%s isn't set)\n", p);
- else
- ! putstring(p2, ed_fp);
- }
- when ':': {
- char new[MAXMSGS_BITS];
- ***************
- *** 851,860 ****
- return 1;
- } else if (line[1] == '?') {
- register int x;
- ! for (x = 0; tilde_commands[x]; x++)
- ! wprint("%s%s\n", escape, tilde_commands[x]);
- ! wprint("%s%s\t\tbegin a line with a single %s\n",
- escape, escape, escape);
- #ifdef SUNTOOL
- if (istool)
- (void) help(0, "compose", tool_help);
- --- 853,877 ----
- return 1;
- } else if (line[1] == '?') {
- register int x;
- ! if (!istool)
- ! (void) do_pager(NULL, TRUE); /* start pager */
- ! for (x = 0; tilde_commands[x]; x++) {
- ! (void) sprintf(buf, "%s%s\n", escape, tilde_commands[x]);
- ! if (!istool) {
- ! if (do_pager(buf, FALSE))
- ! break;
- ! } else
- ! wprint(buf);
- ! }
- ! (void) sprintf(buf, "%s%s\t\tbegin a line with a single %s\n",
- escape, escape, escape);
- + if (istool)
- + wprint(buf);
- + else {
- + if (tilde_commands[x] == NULL)
- + (void) do_pager(buf, FALSE);
- + (void) do_pager(NULL, FALSE); /* end pager */
- + }
- #ifdef SUNTOOL
- if (istool)
- (void) help(0, "compose", tool_help);
- ***************
- *** 970,975 ****
- --- 987,993 ----
- int next_file = 1; /* reserve files[0] for the mail delivery program */
- char buf[3*BUFSIZ];
- char expand = !do_set(set_options, "no_expand");
- + int fork_err = 0;
-
- if (!istool) {
- (void) signal(SIGINT, oldint);
- ***************
- *** 1047,1053 ****
- /* Sign the letter before adding the Bcc list since they aren't
- * considered when adding a signature.
- */
- ! if ((ison(flags, SIGN) || ison(flags, FORTUNE)) &&
- isoff(glob_flags, REDIRECT) && isoff(flags, FORWARD))
- sign_letter(addr_list);
-
- --- 1065,1071 ----
- /* Sign the letter before adding the Bcc list since they aren't
- * considered when adding a signature.
- */
- ! if ((ison(flags, SIGN) || ison(flags, DO_FORTUNE)) &&
- isoff(glob_flags, REDIRECT) && isoff(flags, FORWARD))
- sign_letter(addr_list);
-
- ***************
- *** 1070,1079 ****
- }
- }
-
- ! #ifdef OLD_MAILER
- for (p = buf; p = index(p, ','); p++)
- *p = ' ';
- ! #endif /* OLD_MAILER */
-
- Debug("mail command: %s\n", buf);
-
- --- 1088,1097 ----
- }
- }
-
- ! #ifdef NO_COMMAS
- for (p = buf; p = index(p, ','); p++)
- *p = ' ';
- ! #endif /* NO_COMMAS */
-
- Debug("mail command: %s\n", buf);
-
- ***************
- *** 1105,1117 ****
- break;
- case -1:
- error("fork failed trying to send mail");
- default:
- if (isoff(glob_flags, REDIRECT))
- fclose(ed_fp);
- #ifdef SUNTOOL
- if (istool) {
- ! wprint("Letter sent.");
- ! print("Letter sent.");
- type_cursor(PIX_CLR);
- }
- #endif /* SUNTOOL */
- --- 1123,1138 ----
- break;
- case -1:
- error("fork failed trying to send mail");
- + fork_err++;
- default:
- if (isoff(glob_flags, REDIRECT))
- fclose(ed_fp);
- #ifdef SUNTOOL
- if (istool) {
- ! if (!fork_err) {
- ! wprint("Letter sent.");
- ! print("Letter sent.");
- ! }
- type_cursor(PIX_CLR);
- }
- #endif /* SUNTOOL */
- ***************
- *** 1142,1165 ****
-
- /* Make folders conform to RFC-822 by adding From: and Date: headers.
- * Some older mailers (binmail, execmail, delivermail), don't add
- ! * these headers to the MTA, so add them for OLD_MAILER systems.
- */
- ! for (size = 0; size < next_file; size++) {
- time_t t;
- #ifndef OLD_MAILER
- ! if (size == 0)
- ! continue;
- #endif /* OLD_MAILER */
- ! (void) time(&t);
- ! if (size > 0) {
- #ifndef MSG_SEPARATOR
- ! fprintf(files[size], "From %s %s", login, ctime(&t));
- #else /* MSG_SEPARATOR */
- ! fprintf(files[size], "%s\n", MSG_SEPARATOR);
- #endif /* MSG_SEPARATOR */
- }
- - fprintf(files[size], "From: %s\n", login);
- - fprintf(files[size], "Date: %s", ctime(&t));
- }
-
- /* first print users own message headers */
- --- 1163,1206 ----
-
- /* Make folders conform to RFC-822 by adding From: and Date: headers.
- * Some older mailers (binmail, execmail, delivermail), don't add
- ! * these headers, so add them for #define OLD_MAILER
- */
- ! {
- time_t t;
- + char From_buf[256], *pF = From_buf;
- + char *host = do_set(set_options, "hostname");
- +
- + pF += Strcpy(From_buf, "From: ");
- + if (!host)
- + host = ourname[0];
- + #ifdef UUCP
- + if (host && *host)
- + pF += strlen(sprintf(pF, "%s!", host));
- + #endif /* UUCP */
- + pF += Strcpy(pF, login);
- + #ifndef UUCP
- + if (host && *host)
- + pF += strlen(sprintf(pF, "@%s", host));
- + #endif /* UUCP */
- + if (p = do_set(set_options, "realname"))
- + pF += strlen(sprintf(pF, " (%s)", p));
- + *pF++ = '\n', *pF++ = 0;
- + (void) time(&t);
- + for (size = 0; size < next_file; size++) {
- #ifndef OLD_MAILER
- ! if (size == 0)
- ! continue;
- #endif /* OLD_MAILER */
- ! if (size > 0) {
- #ifndef MSG_SEPARATOR
- ! fprintf(files[size], "From %s %s", login, ctime(&t));
- #else /* MSG_SEPARATOR */
- ! fprintf(files[size], "%s\n", MSG_SEPARATOR);
- #endif /* MSG_SEPARATOR */
- + }
- + fputs(From_buf, files[size]);
- + fprintf(files[size], "Date: %s", ctime(&t));
- }
- }
-
- /* first print users own message headers */
- ***************
- *** 1203,1210 ****
- --- 1244,1253 ----
- */
- while (fgets(buf, BUFSIZ, ed_fp))
- for (size = 0; size < next_file; size++) {
- + #ifdef MSG_SEPARATOR
- if (!strncmp(buf, "From ", 5))
- fputc('>', files[size]);
- + #endif /* MSG_SEPARATOR */
- fputs(buf, files[size]);
- }
-
- ***************
- *** 1230,1235 ****
- --- 1273,1279 ----
- }
-
- /* ARGSUSED */
- + SIGRET
- rm_edfile(sig)
- {
- if (sig > 0 && !killme) {
- ***************
- *** 1419,1429 ****
- if (*buf == '$')
- if (!(p = do_set(set_options, buf)))
- wprint("(%s isn't set -- letter not signed)\n", buf);
- ! else
- ! fprintf(ed_fp, "%s\n", p), wprint("\n"), fflush(ed_fp);
- ! else if (*buf == '\\')
- ! fprintf(ed_fp, "%s\n", buf+1), wprint("\n"), fflush(ed_fp);
- ! else
- file_to_fp(buf, ed_fp, "r");
- }
-
- --- 1463,1476 ----
- if (*buf == '$')
- if (!(p = do_set(set_options, buf)))
- wprint("(%s isn't set -- letter not signed)\n", buf);
- ! else {
- ! putstring(p+1, ed_fp);
- ! wprint("\n");
- ! }
- ! else if (*buf == '\\') {
- ! putstring(buf, ed_fp);
- ! wprint("\n");
- ! } else
- file_to_fp(buf, ed_fp, "r");
- }
-
- *** OLD/main.c Thu May 12 21:14:34 1988
- --- main.c Tue Jun 28 21:38:11 1988
- ***************
- *** 20,25 ****
- --- 20,29 ----
- }
- #endif /* sun && DEBUG */
-
- + #ifdef DOT_LOCK
- + int sgid;
- + #endif /* DOT_LOCK */
- +
- /*ARGSUSED*/ /* we ignore envp */
- main(argc, argv)
- char **argv;
- ***************
- *** 38,43 ****
- --- 42,48 ----
-
- (void) signal(SIGBUS, bus_n_seg);
- (void) signal(SIGSEGV, bus_n_seg);
- + (void) signal(SIGPIPE, SIG_IGN); /* if pager is terminated before end */
-
- f_flags[0] = 0;
- mailfile = "";
- ***************
- *** 58,67 ****
- n = 0; /* don't ignore no such file or directory */
- p = getpath(COMMAND_HELP, &n);
-
- ! if (n) {
- ! fprintf(stderr, "Warning: can't read %s: %s\n", COMMAND_HELP, p);
- cmd_help = "cmd_help";
- ! } else
- strdup(cmd_help, p);
-
- init(); /* must be done before checking mail since "login" is set here */
- --- 63,71 ----
- n = 0; /* don't ignore no such file or directory */
- p = getpath(COMMAND_HELP, &n);
-
- ! if (n)
- cmd_help = "cmd_help";
- ! else
- strdup(cmd_help, p);
-
- init(); /* must be done before checking mail since "login" is set here */
- ***************
- *** 130,135 ****
- --- 134,144 ----
- }
- }
-
- + #ifdef DOT_LOCK
- + sgid = getegid();
- + setgid(getgid());
- + #endif DOT_LOCK
- +
- for (++argv; *argv && **argv == '-'; argv++)
- switch (argv[0][1]) {
- case 'e':
- ***************
- *** 391,402 ****
- #ifdef SUNTOOL
- if (istool) {
- n = 0;
- ! p = getpath(TOOL_HELP, &n);
- ! if (n) {
- ! fprintf(stderr, "Warning: can't read %s: %s\n", TOOL_HELP, p);
- ! tool_help = "tool_help";
- ! } else
- ! strdup(tool_help, p);
- if (time_out < 30)
- time_out = 60;
- turnoff(glob_flags, IGN_SIGS);
- --- 400,413 ----
- #ifdef SUNTOOL
- if (istool) {
- n = 0;
- ! if (!tool_help) {
- ! p = getpath(TOOL_HELP, &n);
- ! if (n) {
- ! fprintf(stderr, "Warning: can't read %s: %s\n", TOOL_HELP, p);
- ! tool_help = "tool_help";
- ! } else
- ! strdup(tool_help, p);
- ! }
- if (time_out < 30)
- time_out = 60;
- turnoff(glob_flags, IGN_SIGS);
- *** OLD/makefile.bsd Thu May 12 21:14:35 1988
- --- makefile.bsd Tue Jun 28 21:38:12 1988
- ***************
- *** 8,14 ****
- signals.o aliases.o setopts.o msgs.o pick.o sort.o expr.o strings.o \
- folders.o dates.o loop.o help.o viewopts.o curses.o curs_io.o bind.o
-
- ! HELP_FILES= README README-6.0 README-6.1 README-6.2 mush.1 cmd_help
-
- MAKES= makefile.bsd makefile.x286 makefile.x386 makefile.sys.v
-
- --- 8,14 ----
- signals.o aliases.o setopts.o msgs.o pick.o sort.o expr.o strings.o \
- folders.o dates.o loop.o help.o viewopts.o curses.o curs_io.o bind.o
-
- ! HELP_FILES= README README-6.0 README-6.1 README-6.2 README-6.3 mush.1 cmd_help
-
- MAKES= makefile.bsd makefile.x286 makefile.x386 makefile.sys.v
-
- *** OLD/makefile.sun Thu May 12 21:14:36 1988
- --- makefile.sun Thu Jun 30 13:05:54 1988
- ***************
- *** 17,23 ****
- IMAGES= mail.icon.1 mail.icon.2 check.pr cycle.pr envelope.pr glasses.pr \
- write.pr up.arrow.pr dn.arrow.pr coffee.cup.pr
-
- ! HELP_FILES= README README-6.0 README-6.1 README-6.2 mush.1 cmd_help tool_help
-
- MAKES= makefile.sun makefile.bsd makefile.sys.v makefile.x286 makefile.x386
-
- --- 17,24 ----
- IMAGES= mail.icon.1 mail.icon.2 check.pr cycle.pr envelope.pr glasses.pr \
- write.pr up.arrow.pr dn.arrow.pr coffee.cup.pr
-
- ! HELP_FILES= README README-6.0 README-6.1 README-6.2 README-6.3 \
- ! mush.1 cmd_help tool_help
-
- MAKES= makefile.sun makefile.bsd makefile.sys.v makefile.x286 makefile.x386
-
- ***************
- *** 31,37 ****
- @cc $(LDFLAGS) $(OBJS) $(LIBES) -o mush
-
- tar:
- ! @tar fcv MUSH $(HELP_FILES) $(MAKES) $(IMAGES) $(HDRS) $(SRCS)
-
- lint:
- make -f makefile.bsd lint
- --- 32,38 ----
- @cc $(LDFLAGS) $(OBJS) $(LIBES) -o mush
-
- tar:
- ! @tar fcv MUSH $(HELP_FILES) $(MAKES) $(IMAGES) $(HDRS) $(SRCS) Mailrc
-
- lint:
- make -f makefile.bsd lint
- *** OLD/makefile.x286 Thu May 12 21:14:37 1988
- --- makefile.x286 Tue Jun 28 21:38:13 1988
- ***************
- *** 10,17 ****
- OBJS= main.o init.o misc.o mail.o hdrs.o execute.o commands.o print.o file.o \
- signals.o aliases.o setopts.o msgs.o pick.o sort.o expr.o strings.o \
- folders.o dates.o loop.o help.o viewopts.o bind.o curses.o curs_io.o
- ! HELP_FILES= README README-6.0 README-6.1 README-6.2 mush.1 cmd_help
- ! MAKES= makefile.sys.v makefile.xenix makefile.bsd
-
- CFLAGS= -O -DSYSV -Mle -DCURSES -DREGCMP -DUSG
- LDFLAGS= -X -Mle -lx -F 4000
- --- 10,17 ----
- OBJS= main.o init.o misc.o mail.o hdrs.o execute.o commands.o print.o file.o \
- signals.o aliases.o setopts.o msgs.o pick.o sort.o expr.o strings.o \
- folders.o dates.o loop.o help.o viewopts.o bind.o curses.o curs_io.o
- ! HELP_FILES= README README-6.0 README-6.1 README-6.2 README-6.3 mush.1 cmd_help
- ! MAKES= makefile.sys.v makefile.x286 makefile.x386 makefile.bsd
-
- CFLAGS= -O -DSYSV -Mle -DCURSES -DREGCMP -DUSG
- LDFLAGS= -X -Mle -lx -F 4000
- *** OLD/makefile.x386 Thu May 12 21:14:37 1988
- --- makefile.x386 Tue Jun 28 21:38:14 1988
- ***************
- *** 10,17 ****
- OBJS= main.o init.o misc.o mail.o hdrs.o execute.o commands.o print.o file.o \
- signals.o aliases.o setopts.o msgs.o pick.o sort.o expr.o strings.o \
- folders.o dates.o loop.o help.o viewopts.o bind.o curses.o curs_io.o
- ! HELP_FILES= README README-6.0 README-6.1 README-6.2 mush.1 cmd_help
- ! MAKES= makefile.sys.v makefile.xenix makefile.bsd
-
- CFLAGS= -O -DSYSV -M3e -DCURSES -DREGCMP -DUSG
- LDFLAGS= -X -M3 -lx
- --- 10,17 ----
- OBJS= main.o init.o misc.o mail.o hdrs.o execute.o commands.o print.o file.o \
- signals.o aliases.o setopts.o msgs.o pick.o sort.o expr.o strings.o \
- folders.o dates.o loop.o help.o viewopts.o bind.o curses.o curs_io.o
- ! HELP_FILES= README README-6.0 README-6.1 README-6.2 README-6.3 mush.1 cmd_help
- ! MAKES= makefile.sys.v makefile.286 makefile.x386 makefile.bsd
-
- CFLAGS= -O -DSYSV -M3e -DCURSES -DREGCMP -DUSG
- LDFLAGS= -X -M3 -lx
- *** OLD/misc.c Thu May 12 21:14:38 1988
- --- misc.c Tue Jun 28 21:38:15 1988
- ***************
- *** 23,31 ****
- }
-
- /*
- ! * loop thru all msgs starting with current_msg and find next undeleted
- ! * message. If the variable "wrap" is set, wrap to the beginning of the
-