home *** CD-ROM | disk | FTP | other *** search
-
- *** OLD/commands.c Wed Apr 6 22:47:58 1988
- --- commands.c Tue Apr 26 20:08:49 1988
- ***************
- *** 747,757 ****
- return -1;
- }
-
- ! Printenv()
- {
- ! char **e = environ;
- ! while (*e)
- ! wprint("%s\n", *e++);
- return -1;
- }
-
- --- 747,759 ----
- return -1;
- }
-
- ! Printenv(argc, argv)
- ! char **argv;
- {
- ! char **e;
- ! for (e = environ; *e; e++)
- ! if (argc < 1 || !strncmp(*e, argv[1]))
- ! wprint("%s\n", *e);
- return -1;
- }
-
- *** OLD/curses.c Wed Apr 6 22:47:58 1988
- --- curses.c Wed Apr 27 21:48:35 1988
- ***************
- *** 120,127 ****
- if (isoff(glob_flags, CNTD_CMD)) {
- (void) check_new_mail();
- curlin = max(1, current_msg - n_array[0] + 1);
- ! (void) strncpy(buf, stdscr->_y[curlin], COLS-1);
- ! buf[COLS-1] = 0; /* strncpy does not null terminate */
- if (ison(glob_flags, REV_VIDEO) && msg_cnt)
- STANDOUT(curlin, 0, buf);
- mail_status(0);
- --- 120,126 ----
- if (isoff(glob_flags, CNTD_CMD)) {
- (void) check_new_mail();
- curlin = max(1, current_msg - n_array[0] + 1);
- ! scrn_line(curlin, buf);
- if (ison(glob_flags, REV_VIDEO) && msg_cnt)
- STANDOUT(curlin, 0, buf);
- mail_status(0);
- ***************
- *** 707,711 ****
- --- 706,726 ----
- }
- turnoff(glob_flags, DO_UPDATE);
- return 1; /* make sure bottom line is clear and no reverse video */
- + }
- +
- + scrn_line(line, buf)
- + char *buf;
- + {
- + #ifndef A_CHARTEXT
- + (void) strncpy(buf, stdscr->_y[line], COLS-1);
- + buf[COLS-1] = 0; /* strncpy does not null terminate */
- + #else
- + int n;
- +
- + for (n = 0; n < COLS; n++)
- + if ((buf = mvinch(curline, n) & A_CHARTEXT) == '\0')
- + break;
- + buf[n] = '\0';
- + #endif /* A_CHARTEXT */
- }
- #endif /* CURSES */
- *** OLD/hdrs.c Wed Apr 6 22:48:00 1988
- --- hdrs.c Tue Apr 26 19:32:11 1988
- ***************
- *** 253,259 ****
- 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];
-
- /* status of the message */
- if (ison(msg[cnt].m_flags, DELETE))
- --- 253,259 ----
- 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))
- ***************
- *** 319,326 ****
- (void) get_name_n_addr(from, name, addr);
- }
-
- ! if (p = msg_date(cnt))
- ! date_to_string(p, Yr, Mon, Day, Wkday, Tm, date);
-
- (void) sprintf(lines, "%d", msg[cnt].m_lines);
- (void) sprintf(chars, "%ld", msg[cnt].m_size);
- --- 319,327 ----
- (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);
-
- (void) sprintf(lines, "%d", msg[cnt].m_lines);
- (void) sprintf(chars, "%ld", msg[cnt].m_size);
- ***************
- *** 394,400 ****
- when 'M': p2 = Mon;
- when 'Y': p2 = Yr;
- when 'N': p2 = Day;
- ! when 'D': p2 = Wkday;
- otherwise: continue; /* unknown formatting char */
- }
- len = strlen(sprintf(b, fmt, p2));
- --- 395,409 ----
- when 'M': p2 = Mon;
- when 'Y': p2 = Yr;
- when 'N': p2 = Day;
- ! when 'D': {
- ! /* specifying weekday name (sun, mon, tue, etc..) can be
- ! * very slow due to lots of *,/, and % operators.
- ! */
- ! char unused[16]; /* for date_to_string */
- ! if (*(p2 = Wkday) == '\0')
- ! (void) date_to_string(date_p, NULL, NULL, NULL,
- ! p2, NULL, unused);
- ! }
- otherwise: continue; /* unknown formatting char */
- }
- len = strlen(sprintf(b, fmt, p2));
- *** OLD/loop.c Wed Apr 6 22:48:00 1988
- --- loop.c Tue Apr 26 18:49:13 1988
- ***************
- *** 51,57 ****
- (void) signal(SIGQUIT, catch);
- (void) signal(SIGHUP, catch);
- (void) signal(SIGTERM, catch);
- ! (void) signal(SIGCHLD, sigchldcatcher);
- (void) signal(SIGPIPE, SIG_IGN); /* if pager is terminated before end */
-
- turnoff(glob_flags, IGN_SIGS);
- --- 51,63 ----
- (void) signal(SIGQUIT, catch);
- (void) signal(SIGHUP, catch);
- (void) signal(SIGTERM, catch);
- ! (void) signal(SIGCHLD,
- ! #ifndef SYSV
- ! sigchldcatcher
- ! #else /* SYSV */
- ! SIG_DFL
- ! #endif /* SYSV */
- ! );
- (void) signal(SIGPIPE, SIG_IGN); /* if pager is terminated before end */
-
- turnoff(glob_flags, IGN_SIGS);
- ***************
- *** 97,103 ****
- * (current message, deleted, unread, etc) are found in mail_status.
- */
- mail_status(1);
- ! if (Getstr(line, 256, 0) > -1)
- p = line;
- else {
- if (p = do_set(set_options, "ignoreeof")) {
- --- 103,109 ----
- * (current message, deleted, unread, etc) are found in mail_status.
- */
- mail_status(1);
- ! if (Getstr(line, sizeof(line), 0) > -1)
- p = line;
- else {
- if (p = do_set(set_options, "ignoreeof")) {
- *** OLD/mail.c Wed Apr 6 22:48:01 1988
- --- mail.c Tue Apr 26 20:09:58 1988
- ***************
- *** 1137,1150 ****
-
- /* 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_MAIL systems.
- */
- for (size = 0; size < next_file; size++) {
- time_t t;
- ! #ifndef OLD_MAIL
- if (size == 0)
- continue;
- ! #endif /* OLD_MAIL */
- (void) time(&t);
- if (size > 0) {
- #ifndef MSG_SEPARATOR
- --- 1137,1150 ----
-
- /* 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
- *** OLD/msgs.c Wed Apr 6 22:48:02 1988
- --- msgs.c Tue Apr 26 20:14:45 1988
- ***************
- *** 305,310 ****
- --- 307,313 ----
- (void) fclose(mail_fp);
- return;
- }
- + (void) fseek(tmpf, 0L, 2); /* assure we're at the end of the file */
- } else if (msg_cnt)
- (void) fseek(tmpf, msg[msg_cnt-1].m_offset+msg[msg_cnt-1].m_size,L_SET);
-
- *** OLD/mush.h Wed Apr 6 22:48:02 1988
- --- mush.h Tue Apr 26 21:09:52 1988
- ***************
- *** 1,6 ****
- /* @(#)mush.h (c) copyright 1986 (Dan Heller) */
-
- ! #define VERSION "Mail User's Shell (Vers 6.0) Sat Apr 2 19:36:07 PST 1988"
-
- #include "config.h"
-
- --- 1,6 ----
- /* @(#)mush.h (c) copyright 1986 (Dan Heller) */
-
- ! #define VERSION "Mail User's Shell (6.1 4/26/88)"
-
- #include "config.h"
-
- ***************
- *** 78,85 ****
- #ifdef putchar
- #undef putchar
- #endif /* putchar */
- ! #define putchar(c) fputc(c, stdout)
- ! #define bell() fputc('\007', stderr)
-
- /* For error recovery purposes, send keyboard generated signals to a special
- * routine (interrupt) to set a global flag (WAS_INTR) and return to the
- --- 78,85 ----
- #ifdef putchar
- #undef putchar
- #endif /* putchar */
- ! #define putchar(c) fputc(c, stdout), fflush(stdout)
- ! #define bell() fputc('\007', stderr), fflush(stderr)
-
- /* For error recovery purposes, send keyboard generated signals to a special
- * routine (interrupt) to set a global flag (WAS_INTR) and return to the
- ***************
- *** 181,190 ****
- #endif /* F_OK */
- typedef unsigned long u_long;
- #define vfork fork
- ! #ifdef SIGCHLD
- ! #undef SIGCHLD
- ! #endif /* SIGCHLD */
- #define SIGCHLD SIGCLD
- #endif /* SYSV */
-
- #if !defined(SUNTOOL) && !defined(CURSES)
- --- 181,189 ----
- #endif /* F_OK */
- typedef unsigned long u_long;
- #define vfork fork
- ! #ifndef SIGCHLD
- #define SIGCHLD SIGCLD
- + #endif /* SIGCHLD */
- #endif /* SYSV */
-
- #if !defined(SUNTOOL) && !defined(CURSES)
- ***************
- *** 277,283 ****
- #define NO_FLG 0
-
- /* various flags */
- ! long glob_flags; /* global boolean flags thruout the whole program */
- #define DO_UPDATE 1 /* check for changes to avoid unnecessary copyback */
- #define REV_VIDEO 2 /* reverse video for curses or toolmode */
- #define CONT_PRNT 3 /* continue to print (maybe a printf) without a '\n' */
- --- 276,282 ----
- #define NO_FLG 0
-
- /* various flags */
- ! u_long glob_flags; /* global boolean flags thruout the whole program */
- #define DO_UPDATE 1 /* check for changes to avoid unnecessary copyback */
- #define REV_VIDEO 2 /* reverse video for curses or toolmode */
- #define CONT_PRNT 3 /* continue to print (maybe a printf) without a '\n' */
- *** OLD/signals.c Wed Apr 6 22:48:03 1988
- --- signals.c Wed Apr 27 21:36:43 1988
- ***************
- *** 179,186 ****
- msg_cnt) {
- int curlin = max(1, current_msg - n_array[0] + 1);
- char buf[256];
- ! (void) strncpy(buf, stdscr->_y[curlin], COLS-1);
- ! buf[COLS-1] = 0; /* strncpy does not null terminate */
- STANDOUT(curlin, 0, buf);
- }
- print("Stopping...");
- --- 179,185 ----
- msg_cnt) {
- int curlin = max(1, current_msg - n_array[0] + 1);
- char buf[256];
- ! scrn_line(curlin, buf);
- STANDOUT(curlin, 0, buf);
- }
- print("Stopping...");
-
- *** OLD/print.c Thu Apr 28 22:45:28 1988
- --- print.c Thu Apr 28 22:45:59 1988
- ***************
- *** 1,3 ****
- --- 1,4 ----
- +
- /* @(#)print.c 2.4 (c) copyright 10/15/86 (Dan Heller) */
-
- #include "mush.h"
- ***************
- *** 36,43 ****
- static int x; /* position on line saved for continued prints */
- char *p; /* same type as struct file _ptr,_buf in stdio.h */
-
- - va_start(args); /* have args point to the beginning of argument stack */
- -
- #ifdef CURSES
- if (iscurses) {
- if (isoff(glob_flags, CONT_PRNT))
- --- 37,42 ----
- ***************
- *** 45,72 ****
- } else
- #endif /* CURSES */
- if (istool < 2) {
- #ifdef VPRINTF
- vprintf(fmt, args);
- #else /* VPRINTF */
- _doprnt(fmt, args, stdout);
- #endif /* VPRINTF */
- - fflush(stdout);
- va_end(args);
- return;
- }
- #ifdef VPRINTF
- ! if (fmt)
- ! vsprintf(msgbuf, fmt, args); /* NULL in fmt reprints last msg */
- #else /* VPRINTF */
- ! foo._cnt = BUFSIZ;
- ! foo._base = foo._ptr = msgbuf; /* may have to be cast(unsigned char *) */
- ! foo._flag = _IOWRT+_IOSTRG;
- ! if (fmt) { /* passing NULL (not "") reprints last message */
- ! (void) _doprnt(fmt, args, &foo);
- ! *foo._ptr = '\0'; /* plant terminating null character */
- }
- - #endif /* VPIRNTF */
- - va_end(args);
- p = msgbuf;
- if (iscurses || istool)
- while (p = index(p, '\n'))
- --- 44,72 ----
- } else
- #endif /* CURSES */
- if (istool < 2) {
- + va_start(args);
- #ifdef VPRINTF
- vprintf(fmt, args);
- #else /* VPRINTF */
- _doprnt(fmt, args, stdout);
- #endif /* VPRINTF */
- va_end(args);
- + fflush(stdout);
- return;
- }
- + if (fmt) {
- + va_start(args);
- #ifdef VPRINTF
- ! vsprintf(msgbuf, fmt, args); /* NULL in fmt reprints last msg */
- #else /* VPRINTF */
- ! foo._cnt = BUFSIZ;
- ! foo._base = foo._ptr = msgbuf; /* may have to be cast(unsigned char *) */
- ! foo._flag = _IOWRT+_IOSTRG;
- ! (void) _doprnt(fmt, args, &foo);
- ! *foo._ptr = '\0'; /* plant terminating null character */
- ! #endif /* VPRINTF */
- ! va_end(args);
- }
- p = msgbuf;
- if (iscurses || istool)
- while (p = index(p, '\n'))
- ***************
- *** 88,93 ****
- --- 88,94 ----
- turnon(glob_flags, CNTD_CMD); /* display ...continue... prompt */
- }
- turnoff(glob_flags, CONT_PRNT);
- + fflush(stdout); /* some sys-v's aren't fflushing \n's */
- return;
- }
- #endif /* CURSES */
- ***************
- *** 117,125 ****
- char msgbuf[BUFSIZ]; /* we're not getting huge strings */
- va_list args;
-
- - va_start(args);
- -
- if (istool < 2) {
- #ifdef VPRINTF
- vprintf(fmt, args);
- #else /* VPRINTF */
- --- 118,125 ----
- char msgbuf[BUFSIZ]; /* we're not getting huge strings */
- va_list args;
-
- if (istool < 2) {
- + va_start(args);
- #ifdef VPRINTF
- vprintf(fmt, args);
- #else /* VPRINTF */
- ***************
- *** 131,136 ****
- --- 131,137 ----
- }
- if (!fmt)
- return;
- + va_start(args);
- #ifdef VPRINTF
- vsprintf(msgbuf, fmt, args); /* NULL in fmt reprints last msg */
- #else /* VPRINTF */
- ***************
- *** 140,145 ****
- --- 141,147 ----
- _doprnt(fmt, args, &foo); /* format like printf into msgbuf via foo */
- *foo._ptr = '\0'; /* plant terminating null character */
- #endif /* VPRINTF */
- + va_end(args);
- Addstr(msgbuf); /* addstr() will scroll if necessary */
- }
-
- ***************
- *** 183,185 ****
- --- 185,188 ----
- {
- print("");
- }
- +
-