home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
unix
/
volume15
/
mush6.2.pch
/
Diffs-6.2
next >
Wrap
Text File
|
1988-05-22
|
39KB
|
1,307 lines
*** OLD/cmd_help Wed Mar 2 12:05:28 1988
--- cmd_help Wed May 11 14:06:12 1988
***************
*** 174,193 ****
%%
%pick%
! use: pick [-r msg_list] [-d [-][date] ] [-s|f|t]] [-x] [-i] [-h hdr] [<pat>]
Search for patterns within messages. Entire messages are searched
for <pattern> unless -s, -f, -t, or -h is specified.
! Only one of -s, -f, -t, -d and -h can be specified at once.
-r msg_list restrict the range of messages search to msg_list
- -d: print message headers on or after [`-' before] `date' (no patterns).
-h hdr requires a header to be searched for. Pattern searched in that hdr.
! `date' is of the form: month/date/year
Omitted fields default to today's values. Examples:
! pick -d 4/20 msgs on or after Apr 20, this year
pick -d -/2/85 on or before the 2nd, this month, 1985
! pick -d / finds today's messages only.
At least one `/' char must be used in date.
There is no strong date checking; 2/30 would be considered valid
-s search for pattern in the "subject" headers only.
-f search for pattern in the "from" field (author) only.
-t search for pattern in the "to" field.
--- 174,196 ----
%%
%pick%
! use: pick [-r msg_list] [-d [-][date] ] [-s|f|t]] [-x] [-i]
! [-h hdr] [-ago [n days] [n weeks] [n months] ] [<pat>]
Search for patterns within messages. Entire messages are searched
for <pattern> unless -s, -f, -t, or -h is specified.
! Only one of -s, -f, -t, -d, -ago and -h can be specified at once.
-r msg_list restrict the range of messages search to msg_list
-h hdr requires a header to be searched for. Pattern searched in that hdr.
! -d: print headers on or [+ after] [- before] `date' (no pattern search).
! `date' is of the form: [+-] [month]/[date/year]
Omitted fields default to today's values. Examples:
! pick -d 4/20 messages on Apr 20, this year
pick -d -/2/85 on or before the 2nd, this month, 1985
! pick -d +5/4 on or after May 4, this year
! pick -d / finds today's messages only
At least one `/' char must be used in date.
There is no strong date checking; 2/30 would be considered valid
+ -ago search for messages relative to the current date (see manual).
-s search for pattern in the "subject" headers only.
-f search for pattern in the "from" field (author) only.
-t search for pattern in the "to" field.
*** OLD/commands.c Thu May 12 13:51:57 1988
--- commands.c Wed May 11 21:47:30 1988
***************
*** 752,758 ****
{
char **e;
for (e = environ; *e; e++)
! if (argc < 1 || !strncmp(*e, argv[1]))
wprint("%s\n", *e);
return -1;
}
--- 752,758 ----
{
char **e;
for (e = environ; *e; e++)
! if (argc < 2 || !strncmp(*e, argv[1]))
wprint("%s\n", *e);
return -1;
}
*** OLD/curs_io.c Mon Mar 7 14:57:23 1988
--- curs_io.c Wed May 11 20:38:32 1988
***************
*** 135,140 ****
--- 135,141 ----
Addch(c);
}
}
+ fflush(stdout); /* for sys-v folks */
if (c == CTRL(D) || c == EOF || ison(glob_flags, WAS_INTR)) {
if (feof(stdin))
clearerr(stdin);
*** OLD/curses.c Thu May 12 13:52:00 1988
--- curses.c Wed May 11 10:39:41 1988
***************
*** 718,724 ****
int n;
for (n = 0; n < COLS; n++)
! if ((buf = mvinch(curline, n) & A_CHARTEXT) == '\0')
break;
buf[n] = '\0';
#endif /* A_CHARTEXT */
--- 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 */
*** OLD/execute.c Sat Apr 2 16:14:19 1988
--- execute.c Wed May 11 16:17:13 1988
***************
*** 68,74 ****
* if other forks die (sendmail), then this wait will catch them,
* This loop will really get -1, cuz sigchldcatcher will catch all else.
*/
! while ((pid = wait(&status) != -1) && pid != exec_pid)
Debug("The exec loop caught a signal? (pid = %d)\n", pid);
/* reset our ttymodes */
echo_off();
--- 68,74 ----
* if other forks die (sendmail), then this wait will catch them,
* This loop will really get -1, cuz sigchldcatcher will catch all else.
*/
! while ((pid = wait(&status)) != -1 && pid != exec_pid)
Debug("The exec loop caught a signal? (pid = %d)\n", pid);
/* reset our ttymodes */
echo_off();
*** OLD/help.c Mon Dec 7 18:37:47 1987
--- help.c Wed May 11 16:08:07 1988
***************
*** 72,77 ****
--- 72,79 ----
#include <sys/types.h>
#define wprint printf
#define print printf
+ #define TRUE 1
+ #define FALSE 0
#endif /* SUNTOOL */
***************
*** 311,320 ****
if (height == MAXLINES - 1)
print("Help message is too long!\n");
for (n = 0; n < height; n++) {
(void) no_newln(args[n]);
! wprint("%s\n", args[n]);
}
return 0;
}
--- 313,326 ----
if (height == MAXLINES - 1)
print("Help message is too long!\n");
+ do_pager(NULL, TRUE);
for (n = 0; n < height; n++) {
(void) no_newln(args[n]);
! (void) do_pager(args[n], FALSE);
! if (do_pager("\n", FALSE) == EOF)
! break;
}
+ do_pager(NULL, FALSE);
return 0;
}
*** OLD/loop.c Thu May 12 13:52:05 1988
--- loop.c Wed May 11 21:31:42 1988
***************
*** 106,112 ****
if (Getstr(line, sizeof(line), 0) > -1)
p = line;
else {
! if (p = do_set(set_options, "ignoreeof")) {
if (!*p)
continue;
else
--- 106,112 ----
if (Getstr(line, sizeof(line), 0) > -1)
p = line;
else {
! if (isatty(0) && (p = do_set(set_options, "ignoreeof"))) {
if (!*p)
continue;
else
*** OLD/mail.c Sat May 21 10:53:59 1988
--- mail.c Sat May 21 10:56:08 1988
***************
*** 10,17 ****
* mail_someone() called from do_mail() or from the shell.
* add_to_letter() adds the next line to letter --determine ~ escapes.
* finish_up_letter() prompts for Cc:, verifies user really wants to send
! * send_it() invokes mailer, sends to record file, adds signature,
! * fortune, expands aliases, adds own_hdrs.
* rm_edfile() signals are directed here. remove letter, longjmp
*
* The flow of control in this file is NOT obvious to allow for both text
--- 10,18 ----
* mail_someone() called from do_mail() or from the shell.
* add_to_letter() adds the next line to letter --determine ~ escapes.
* finish_up_letter() prompts for Cc:, verifies user really wants to send
! * send_it() invokes mailer, sends to record file, expands aliases,
! * adds own_hdrs.
! * sign_letter() adds signature and fortunes.
* rm_edfile() signals are directed here. remove letter, longjmp
*
* The flow of control in this file is NOT obvious to allow for both text
***************
*** 283,296 ****
start_file(list)
char *list;
{
! register char *home;
register int i;
char line[MAXPATHLEN];
! if (!(home = do_set(set_options, "home")) || !*home)
alted:
! home = ALTERNATE_HOME;
! (void) mktemp(sprintf(line, "%s/%s", home, EDFILE));
strdup(edfile, line);
{
int omask = umask(077);
--- 284,298 ----
start_file(list)
char *list;
{
! register char *dir;
register int i;
char line[MAXPATHLEN];
! if (!(dir = do_set(set_options, "tmpdir")) &&
! !(dir = do_set(set_options, "home")))
alted:
! dir = ALTERNATE_HOME;
! (void) mktemp(sprintf(line, "%s/%s", dir, EDFILE));
strdup(edfile, line);
{
int omask = umask(077);
***************
*** 297,303 ****
ed_fp = fopen(edfile, "w+");
(void) umask(omask);
if (!ed_fp) {
! if (home != ALTERNATE_HOME)
goto alted;
#ifdef SUNTOOL
if (istool)
--- 299,305 ----
ed_fp = fopen(edfile, "w+");
(void) umask(omask);
if (!ed_fp) {
! if (dir != ALTERNATE_HOME)
goto alted;
#ifdef SUNTOOL
if (istool)
***************
*** 407,415 ****
* be cleared cuz it's a new call.
*/
(void) setjmp(cntrl_c_buf);
! while (Getstr(line, sizeof(line), 0) > -1)
if ((i = add_to_letter(line)) <= 0)
break;
} while (i >= 0 && !finish_up_letter());
return i; /* return -1 if ~x or ~q to terminate letter */
}
--- 409,419 ----
* be cleared cuz it's a new call.
*/
(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;
+ }
} while (i >= 0 && !finish_up_letter());
return i; /* return -1 if ~x or ~q to terminate letter */
}
***************
*** 513,519 ****
if (!*p || *p == 'i' && !p[1])
switch (line[1]) {
case 'p' :
! if (!(p = do_set(set_options, "pager")))
p = DEF_PAGER;
if (!*p || !strcmp(p, "internal"))
p = NULL;
--- 517,523 ----
if (!*p || *p == 'i' && !p[1])
switch (line[1]) {
case 'p' :
! if (!*p && !(p = do_set(set_options, "pager")))
p = DEF_PAGER;
if (!*p || !strcmp(p, "internal"))
p = NULL;
***************
*** 1043,1049 ****
/* Sign the letter before adding the Bcc list since they aren't
* considered when adding a signature.
*/
! if (ison(flags, SIGN) && isoff(glob_flags, REDIRECT))
sign_letter(addr_list);
if (*Bcc) {
--- 1047,1054 ----
/* 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);
if (*Bcc) {
***************
*** 1351,1357 ****
register char *list; /* list of addresses -- no comment fields */
{
char buf[BUFSIZ];
! register char *p, *p2, *signature, *addr;
FILE *pp2;
int lines = 0;
--- 1356,1362 ----
register char *list; /* list of addresses -- no comment fields */
{
char buf[BUFSIZ];
! register char *p = NULL, *p2, *signature, *addr;
FILE *pp2;
int lines = 0;
***************
*** 1358,1424 ****
buf[0] = 0;
while (isspace(*list))
list++;
! if (p = do_set(set_options, "autosign2")) {
! if (!(signature = index(p, ':')))
! wprint("\"autosign2\" incorrectly set (missing `:').\n");
! else {
! int ret_val = 0;
! *signature = 0;
! /* p now points to a list of addresses and p2 points to the
! * signature format to use. Check that each address contains
! * the stuff in alternate sign.
! */
! skipspaces(0);
! if (!*p)
! /* autosign2 = " : <signature>" send to all recipients */
! ret_val = 1;
! else if (p = alias_to_address(p)) {
! rm_cmts_in_addr(p);
! for (addr = list;;) {
! char c;
! if (p2 = any(addr, ", ")) {
! c = *p2;
! *p2 = 0;
}
- ret_val = chk_two_lists(addr, p, ", ");
- if (p2)
- for (*p2++ = c; isspace(*p2) || *p2 == ','; p2++)
- ;
- if (!ret_val || !(addr = p2))
- break;
}
}
- *signature++ = ':'; /* must reset first! */
- if (ret_val) {
- while (isspace(*signature))
- signature++;
- if (!*strcpy(buf, signature))
- return;
- }
}
! }
! if (!buf[0]) {
! if (!(p = do_set(set_options, "autosign")) || !*p) {
! char *home;
! if (!(home = do_set(set_options, "home")) || !*home)
! home = ALTERNATE_HOME;
! (void) sprintf(buf, "%s/%s", home, SIGNATURE);
} else
! (void) strcpy(buf, p);
! wprint("Signing letter... ");
! } else
! wprint("Using alternate signature... ");
! fputc('\n', ed_fp), fflush(ed_fp);
! (void) fseek(ed_fp, 0L, 2); /* guarantee position at end of file */
! 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");
/* if fortune is set, check to see if fortunates is set. If so,
* check to see if all the recipient are on the fortunates list.
--- 1363,1431 ----
buf[0] = 0;
while (isspace(*list))
list++;
! if (ison(flags, SIGN)) {
! if (p = do_set(set_options, "autosign2")) {
! if (!(signature = index(p, ':')))
! (void) strcpy(buf, p); /* No colon; use entire string as sig */
! else {
! int ret_val = 0;
! *signature = 0;
! /* p now points to a list of addresses and p2 points to the
! * signature format to use. Check that each address contains
! * the stuff in alternate sign.
! */
! skipspaces(0);
! if (!*p)
! /* autosign2 = " : <signature>" send to all recipients */
! ret_val = 1;
! else if (p = alias_to_address(p)) {
! rm_cmts_in_addr(p);
! for (addr = list;;) {
! char c;
! if (p2 = any(addr, ", ")) {
! c = *p2;
! *p2 = 0;
! }
! ret_val = chk_two_lists(addr, p, ", ");
! if (p2)
! for (*p2++ = c; isspace(*p2) || *p2 == ','; p2++)
! ;
! if (!ret_val || !(addr = p2))
! break;
}
}
+ *signature++ = ':'; /* must reset first! */
+ if (ret_val) {
+ while (isspace(*signature))
+ signature++;
+ if (!*strcpy(buf, signature))
+ return;
+ }
}
}
! if (!buf[0]) {
! if (!(p = do_set(set_options, "autosign")) || !*p) {
! char *home;
! if (!(home = do_set(set_options, "home")) || !*home)
! home = ALTERNATE_HOME;
! (void) sprintf(buf, "%s/%s", home, SIGNATURE);
! } else
! (void) strcpy(buf, p);
! wprint("Signing letter... ");
} else
! wprint("Using alternate signature... ");
! fputs("\n-- \n", ed_fp), fflush(ed_fp);
! (void) fseek(ed_fp, 0L, 2); /* guarantee position at end of file */
! 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");
! }
/* if fortune is set, check to see if fortunates is set. If so,
* check to see if all the recipient are on the fortunates list.
*** OLD/main.c Thu Apr 7 22:47:31 1988
--- main.c Thu May 12 17:14:16 1988
***************
*** 25,32 ****
char **argv;
{
u_long flg = NO_FLG;
! int n, source_rc = TRUE;
! char f_flags[10], buf[256], *Cc = NULL, *Subj = NULL;
register char *p;
char **args;
--- 25,33 ----
char **argv;
{
u_long flg = NO_FLG;
! int n, source_rc = TRUE, src_n_exit;
! char f_flags[10], buf[256];
! char *Cc = NULL, *Subj = NULL, *src_file = NULL;
register char *p;
char **args;
***************
*** 93,98 ****
--- 94,100 ----
#endif /* SUNTOOL */
case 'S' : turnon(glob_flags, DO_SHELL);
case 'f' :
+ case 'F' :
case 'u' :
if (args[1])
args++;
***************
*** 147,153 ****
else
turnon(glob_flags, PRE_CURSES);
#endif /* CURSES */
! when 'N':
(void) strcat(f_flags, "-N ");
when 'r':
(void) strcat(f_flags, "-r "); /* folder() argument */
--- 149,160 ----
else
turnon(glob_flags, PRE_CURSES);
#endif /* CURSES */
! when 'F':
! src_n_exit = (argv[0][2] == '!');
! if (!(src_file = *++argv))
! puts("specify filename to source"), exit(1);
! /* fall thru! */
! case 'N':
(void) strcat(f_flags, "-N ");
when 'r':
(void) strcat(f_flags, "-r "); /* folder() argument */
***************
*** 228,233 ****
--- 235,241 ----
}
if (source_rc) {
+ /* use cmd_line() in case DEFAULT_RC has expandable chars */
(void) cmd_line(sprintf(buf, "source %s", DEFAULT_RC), msg_list);
(void) source(0, DUBL_NULL);
}
***************
*** 322,328 ****
}
/* find a free tmpfile */
! if (!(p = do_set(set_options, "home")) || !*p)
alted:
p = ALTERNATE_HOME;
flg = getpid();
--- 330,337 ----
}
/* find a free tmpfile */
! if (!(p = do_set(set_options, "tmpdir")) &&
! !(p = do_set(set_options, "home")))
alted:
p = ALTERNATE_HOME;
flg = getpid();
***************
*** 348,354 ****
(void) signal(SIGQUIT, catch);
(void) signal(SIGHUP, catch);
! if (!hdrs_only && !istool && !do_set(set_options, "quiet"))
printf("%s: Type '?' for help.\n", VERSION);
(void) sprintf(buf, "folder %s %s", f_flags, mailfile);
--- 357,364 ----
(void) signal(SIGQUIT, catch);
(void) signal(SIGHUP, catch);
! if (!hdrs_only && !istool && (!src_file || !src_n_exit) &&
! !do_set(set_options, "quiet"))
printf("%s: Type '?' for help.\n", VERSION);
(void) sprintf(buf, "folder %s %s", f_flags, mailfile);
***************
*** 368,373 ****
--- 378,392 ----
turnon(glob_flags, DO_SHELL);
if (istool && msg_cnt)
set_isread(current_msg);
+
+ /* finally, if the user wanted to source a file to execute, do it now */
+ if (src_file) {
+ char *s_argv[2];
+ s_argv[1] = src_file;
+ (void) source(2, s_argv);
+ if (!istool && src_n_exit)
+ cleanup(0);
+ }
#ifdef SUNTOOL
if (istool) {
*** OLD/makefile.bsd Thu Apr 7 22:47:37 1988
--- makefile.bsd Wed May 11 15:53:44 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,15 ----
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 README-6.0 README-6.1 README-6.2 mush.1 cmd_help
!
MAKES= makefile.bsd makefile.x286 makefile.x386 makefile.sys.v
CFLAGS= -O -DCURSES -DBSD
*** OLD/makefile.sun Thu Apr 7 22:47:40 1988
--- makefile.sun Wed May 11 15:53:25 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-6.0 README cmd_help tool_help mush.1
MAKES= makefile.sun makefile.bsd makefile.sys.v makefile.x286 makefile.x386
--- 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
*** OLD/makefile.x286 Tue Apr 12 22:00:18 1988
--- makefile.x286 Wed May 11 15:54:23 1988
***************
*** 10,16 ****
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
! DOCS= README cmd_help mush.1
MAKES= makefile.sys.v makefile.xenix makefile.bsd
CFLAGS= -O -DSYSV -Mle -DCURSES -DREGCMP -DUSG
--- 10,16 ----
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
***************
*** 28,34 ****
cc $(CFLAGS) -LARGE -c bind.c
shar:
! shar ${DOCS} ${MAKES} ${HDRS}>hdr.shr
shar ${SRCS1} > src1.shr
shar ${SRCS2} > src2.shr
shar ${SRCS3} > src3.shr
--- 28,34 ----
cc $(CFLAGS) -LARGE -c bind.c
shar:
! shar ${HELP_FILES} ${MAKES} ${HDRS}>hdr.shr
shar ${SRCS1} > src1.shr
shar ${SRCS2} > src2.shr
shar ${SRCS3} > src3.shr
***************
*** 39,45 ****
shar ${SRCS8} > src8.shr
tar:
! tar fcv MUSH ${MAKES} ${HDRS} ${DOCS} ${SRCS1} \
${SRCS2} ${SRCS3} ${SRCS4} ${SRCS5} ${SRCS6} ${SRCS7} ${SRCS}8
clean:
--- 39,45 ----
shar ${SRCS8} > src8.shr
tar:
! tar fcv MUSH ${MAKES} ${HDRS} ${HELP_FILES} ${SRCS1} \
${SRCS2} ${SRCS3} ${SRCS4} ${SRCS5} ${SRCS6} ${SRCS7} ${SRCS}8
clean:
*** OLD/makefile.x386 Tue Apr 12 21:59:57 1988
--- makefile.x386 Wed May 11 15:54:42 1988
***************
*** 10,16 ****
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
! DOCS= README cmd_help mush.1
MAKES= makefile.sys.v makefile.xenix makefile.bsd
CFLAGS= -O -DSYSV -M3e -DCURSES -DREGCMP -DUSG
--- 10,16 ----
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
***************
*** 25,31 ****
cc $(CFLAGS) -LARGE -c bind.c
shar:
! shar ${DOCS} ${MAKES} ${HDRS}>hdr.shr
shar ${SRCS1} > src1.shr
shar ${SRCS2} > src2.shr
shar ${SRCS3} > src3.shr
--- 25,31 ----
cc $(CFLAGS) -LARGE -c bind.c
shar:
! shar ${HELP_FILES} ${MAKES} ${HDRS}>hdr.shr
shar ${SRCS1} > src1.shr
shar ${SRCS2} > src2.shr
shar ${SRCS3} > src3.shr
***************
*** 36,42 ****
shar ${SRCS8} > src8.shr
tar:
! tar fcv MUSH ${MAKES} ${HDRS} ${DOCS} ${SRCS1} \
${SRCS2} ${SRCS3} ${SRCS4} ${SRCS5} ${SRCS6} ${SRCS7} ${SRCS8}
clean:
--- 36,42 ----
shar ${SRCS8} > src8.shr
tar:
! tar fcv MUSH ${MAKES} ${HDRS} ${HELP_FILES} ${SRCS1} \
${SRCS2} ${SRCS3} ${SRCS4} ${SRCS5} ${SRCS6} ${SRCS7} ${SRCS8}
clean:
*** OLD/misc.c Thu Apr 7 22:47:54 1988
--- misc.c Wed May 11 14:01:36 1988
***************
*** 354,363 ****
turnon(glob_flags, IGN_SIGS);
if (!buf)
pp = stdout;
! else if (!(pp = popen(buf, "w")))
! error(buf);
! else
echo_on();
cnt = 0;
} else if (!buf) {
if (pp && pp != stdout)
--- 354,364 ----
turnon(glob_flags, IGN_SIGS);
if (!buf)
pp = stdout;
! else {
echo_on();
+ if (!(pp = popen(buf, "w")))
+ error(buf);
+ }
cnt = 0;
} else if (!buf) {
if (pp && pp != stdout)
*** OLD/mush.1 Wed Apr 6 00:34:07 1988
--- mush.1 Thu May 12 17:08:32 1988
***************
*** 60,65 ****
--- 60,70 ----
.B \-f
[ folder ]
]
+ [
+ .B \-F
+ [!]
+ [ file ]
+ ]
.br
.B mush
[
***************
*** 126,131 ****
--- 131,140 ----
.B \-f
[ folder ]
]
+ [
+ .B \-F
+ [ file ]
+ ]
.br
.B mush
[
***************
*** 218,223 ****
--- 227,244 ----
.B debug
command.
.TP
+ \-F[!] filename
+ This file is the same type as the initialization file read on startup
+ (see INITIALIZATION) with the exception that commands which manipulate
+ or search messages may be given. Normally, such commands may not exist
+ in the initialization file since that file is read before the folder
+ is scanned. This file is read after the folder is scanned, so commands
+ which change folders are allowed.
+ The optional `!' argument prevents the shell from running after the file
+ has been sourced. Otherwise,
+ .I Mush
+ continues into whatever interface has been specified.
+ .TP
\-f [ filename ]
The optional filename argument specifies a folder containing mail messages.
With no argument,
***************
*** 2069,2091 ****
Options:
.ta 1.5i
.in +2
! \-d [\-]date messages sent on or after [`\-' before] date
! \-f search for pattern in \*QFrom\*U field only
! \-h header search for pattern in specified header only
! \-i ignore case of letters when searching
! \-r msg_list search only the listed messages
! \-s search for pattern in \*QSubject\*U field only
! \-t search for pattern in \*QTo\*U field only
! \-x select messages not containing the pattern
.in -2
.fi
.sp
! Only one of \-d, \-f, \-h, \-s and \-t can be specified at once.
Entire messages are scanned for the <pattern>
! unless \-f, \-h, \-s or \-t is specified.
Messages marked for deletion are also searched.
! No patterns can be specified with the \-d option,
! and the \-x option may not be used with \-d.
.sp
For the \-d option, \*Qdate\*U is of the form:
.sp
--- 2090,2112 ----
Options:
.ta 1.5i
.in +2
! \-d [+-]date messages sent on or [+ after] [`\-' before] date.
! \-ago <format> search for messages relative to today's date.
! \-f search for pattern in \*QFrom\*U field only.
! \-i ignore case of letters when searching.
! \-r msg_list search only the listed messages.
! \-s search for pattern in \*QSubject\*U field only.
! \-t search for pattern in \*QTo\*U field only.
! \-h header search for pattern in specified header only.
! \-x select messages not containing the pattern.
.in -2
.fi
.sp
! Only one of \-d, \-a, \-f, \-h, \-s and \-t can be specified at once.
Entire messages are scanned for the <pattern>
! unless \-d, \-a, \-f, \-h, \-s or \-t is specified.
Messages marked for deletion are also searched.
! No patterns can be specified with the \-d or \-a options.
.sp
For the \-d option, \*Qdate\*U is of the form:
.sp
***************
*** 2100,2108 ****
.in +2
.ta 2.0i
.sp
! pick \-d 4/20 on or after April 20, this year
! pick \-d \-/2/85 on or before the 2nd, this month, 1985
! pick \-d / today only
.fi
.in -2
.sp
--- 2121,2130 ----
.in +2
.ta 2.0i
.sp
! pick \-d 4/20 on April 20, this year.
! pick \-d \-/2/85 on or before the 2nd, this month, 1985.
! pick \-d +5/4 on or after May 4 of this year.
! pick \-d / today only.
.fi
.in -2
.sp
***************
*** 2109,2114 ****
--- 2131,2159 ----
At least one `/' char must be used in a date.
There is no strong date checking; 2/30 would be considered a valid date.
.sp
+ For the \-ago option, the format is very simple. Specify the number of
+ days followed by the word \*Qdays\*U, or the number of weeks followed by
+ the word \*Qweeks\*U, and so on with months and years. Truncation is allowed,
+ since only the first character is examined, so all of the following are
+ equivalent:
+ .sp
+ .in +2
+ pick -ago 1 day, 2 weeks
+ pick -ago 2Weeks 1Day
+ pick -ago 2w,1day
+ pick -a 2w1d
+ .in -2
+ These examples will find all messages that are exactly 2 weeks and 1 day
+ old. All \*Qago\*U dates collapse into \*Qday\*U time segments. This
+ means that months are 30.5 days long. If more precise date selection is
+ required, use the \-d option and specify specific dates.
+ .sp
+ Also note that the -ago option allows the \*Qbefore\*U (-) and \*Qafter\*U (+)
+ arguments. Thus, you may pick for all messages older than 1 week with:
+ .sp
+ .ti +2
+ pick -ago -1 week
+ .sp
Other examples of
.B pick:
.sp
***************
*** 2116,2127 ****
pick \-d 2/5/86 | pick \-d \-2/5/87 | pick \-s "mail stuff" | lpr
.sp
will find all the messages between the dates February 5, 1986 and
! February 5, 1987 that contain the subject "mail stuff" and print them.
.sp
.ti +2
pick -s Re: | delete
.sp
! deletes messages that have \*QRe:\*U in the subject
.sp
.ti +2
folder +project | pick -f frank
--- 2161,2173 ----
pick \-d 2/5/86 | pick \-d \-2/5/87 | pick \-s "mail stuff" | lpr
.sp
will find all the messages between the dates February 5, 1986 and
! February 5, 1987 that contain the subject "mail stuff" and send them
! to the printer.
.sp
.ti +2
pick -s Re: | delete
.sp
! deletes messages that have \*QRe:\*U in the Subject header.
.sp
.ti +2
folder +project | pick -f frank
***************
*** 2135,2140 ****
--- 2181,2192 ----
if the string \*Qucbvax\*U is in the header.
Note that case sensitivity
applies only to the pattern searched, not the header itself.
+ .sp
+ .ti +2
+ pick -ago +1w | save +current
+ .sp
+ This finds all messages that are a week or less old and saves them in the file
+ called \fIcurrent\fR, which is found in the user's \fIfolder\fR variable.
.TP
.B preserve
.RB ( pre )
***************
*** 3287,3292 ****
--- 3339,3353 ----
(Boolean)
Whenever messages are read, piped, or saved, if this variable is set,
all consecutive blank lines are squeezed into one blank line.
+ .TP
+ .B tmpdir
+ (String)
+ This variable describes the path to use as the directory to use
+ for all tempfiles that
+ .I Mush
+ uses. By default, the user's home directory is used. If that
+ cannot be accessed, a directory writable by all is used (typically, /tmp).
+ If \fBtmpdir\fR is set, then it is used first.
.TP
.B toplines
(Numeric)
*** OLD/mush.h Thu May 12 13:52:11 1988
--- mush.h Wed May 11 15:19:26 1988
***************
*** 1,6 ****
/* @(#)mush.h (c) copyright 1986 (Dan Heller) */
! #define VERSION "Mail User's Shell (6.1 4/26/88)"
#include "config.h"
--- 1,6 ----
/* @(#)mush.h (c) copyright 1986 (Dan Heller) */
! #define VERSION "Mail User's Shell (6.2 5/11/88)"
#include "config.h"
*** OLD/pick.c Tue Mar 1 14:59:20 1988
--- pick.c Wed May 11 15:51:46 1988
***************
*** 2,9 ****
#include "mush.h"
! static int before, mdy[3], search_from, search_subj, search_to, xflg, icase;
! static search_hdr[64];
do_pick(n, argv, list)
register int n;
--- 2,9 ----
#include "mush.h"
! static int before, after, search_from, search_subj, search_to, xflg, icase;
! static mdy[3], search_hdr[64];
do_pick(n, argv, list)
register int n;
***************
*** 38,45 ****
register char **argv, list[];
{
register char c;
! int o_before = before, o_mdy[3], o_search_from = search_from,
! o_search_subj = search_subj, o_search_to = search_to, o_xflg = xflg, n;
for (c = 0; c < 3; c++)
o_mdy[c] = mdy[c];
--- 38,46 ----
register char **argv, list[];
{
register char c;
! int o_before = before, o_after = after, o_search_from = search_from,
! o_search_subj = search_subj, o_search_to = search_to, o_xflg = xflg,
! o_mdy[3], n;
for (c = 0; c < 3; c++)
o_mdy[c] = mdy[c];
***************
*** 50,56 ****
goto bad;
}
! icase = before = search_from = search_subj = xflg = 0;
mdy[0] = search_hdr[0] = 0;
while (*argv && *++argv && **argv == '-')
switch(c = argv[0][1]) {
--- 51,57 ----
goto bad;
}
! icase = before = after = search_from = search_subj = xflg = 0;
mdy[0] = search_hdr[0] = 0;
while (*argv && *++argv && **argv == '-')
switch(c = argv[0][1]) {
***************
*** 76,81 ****
--- 77,88 ----
goto bad;
argv += (n-1); /* we're going to increment another up top */
}
+ when 'a': {
+ int n = ago_date(++argv);
+ if (n == -1)
+ goto bad;
+ argv += n;
+ }
when 'd':
if (!*++argv) {
print("specify a date for -%c\n", c);
***************
*** 108,129 ****
}
if (verbose) {
print_more("Searching for messages");
! if (mdy[1] == 0)
print(" that %s \"%s\"", (xflg)? "doesn't contain": "contains",
(*argv)? *argv: "<previous expression>");
! if (search_subj)
! print_more(" in subject line");
! else if (search_from)
! print_more(" from author names");
! else if (search_to)
! print_more(" from the To: field");
! else if (search_hdr[0])
! print_more(" from the message header: \"%s:\"", search_hdr);
! if (mdy[1] > 0) {
extern char *month_names[]; /* from dates.c */
! print_more(" dated on or %s %s. %d, 19%d.",
! (before)? "before": "after",
! month_names[mdy[0]], mdy[1], mdy[2]);
}
print_more("\n");
}
--- 115,138 ----
}
if (verbose) {
print_more("Searching for messages");
! if (mdy[1] == 0) {
print(" that %s \"%s\"", (xflg)? "doesn't contain": "contains",
(*argv)? *argv: "<previous expression>");
! if (search_subj)
! print_more(" in subject line");
! else if (search_from)
! print_more(" from author names");
! else if (search_to)
! print_more(" from the To: field");
! else if (search_hdr[0])
! print_more(" from the message header: \"%s:\"", search_hdr);
! } else {
extern char *month_names[]; /* from dates.c */
! print_more(" dated ");
! if (before || after)
! print_more("on or %s ", (before)? "before": "after");
! print_more("%s. %d, 19%d.",
! month_names[mdy[0]], mdy[1], mdy[2]);
}
print_more("\n");
}
***************
*** 131,137 ****
print("using date: -i flag ignored.\n");
ret = find_pattern(*argv, list);
bad:
! before = o_before, search_from = o_search_from;
search_subj = o_search_subj, search_to = o_search_to, xflg = o_xflg;
for (c = 0; c < 3; c++)
mdy[c] = o_mdy[c];
--- 140,146 ----
print("using date: -i flag ignored.\n");
ret = find_pattern(*argv, list);
bad:
! before = o_before, after = o_after, search_from = o_search_from;
search_subj = o_search_subj, search_to = o_search_to, xflg = o_xflg;
for (c = 0; c < 3; c++)
mdy[c] = o_mdy[c];
***************
*** 197,204 ****
*/
for (i = 2; i < 5; i++)
if (before && msg_mdy[i%3] < mdy[i%3]
! || !before && msg_mdy[i%3] > mdy[i%3]
! || i == 4 && (msg_mdy[i%3] == mdy[i%3])) {
Debug("matched (%s).\n",
(i == 2)? "year" : (i == 3)? "month" : "day");
break;
--- 206,213 ----
*/
for (i = 2; i < 5; i++)
if (before && msg_mdy[i%3] < mdy[i%3]
! || after && msg_mdy[i%3] > mdy[i%3]
! || i == 4 && (msg_mdy[i%3] == mdy[i%3])) {
Debug("matched (%s).\n",
(i == 2)? "year" : (i == 3)? "month" : "day");
break;
***************
*** 373,380 ****
int i;
struct tm *today;
! if (*p == '-') {
! before = 1;
skipspaces(1);
}
if (!isdigit(*p) && *p != '/') {
--- 382,389 ----
int i;
struct tm *today;
! if (*p == '-' || *p == '+') {
! before = !(after = *p == '+');
skipspaces(1);
}
if (!isdigit(*p) && *p != '/') {
***************
*** 406,409 ****
--- 415,484 ----
p++;
}
return 1;
+ }
+
+ /*
+ * Parse arguments specifying days/months/years "ago" (relative to today).
+ * Legal syntax: -ago [+-][args]
+ * where "args" is defined to be:
+ * [0-9]+[ ]*[dD][a-Z]*[ ,]*[0-9]+[mM][a-Z]*[ ,]*[0-9]+[ ]*[yY][a-Z]*
+ * 1 or more digits, 0 or more spaces, d or D followed by 0 or more chars,
+ * 0 or more whitespaces or commas, repeat for months and years...
+ * Examples:
+ * 1 day, 2 months, 0 years
+ * 2 weeks 1 year
+ * 10d, 5m
+ * 3w
+ * 1d 1Y
+ *
+ * Return number of args parsed; -1 on error.
+ */
+ ago_date(argv)
+ char **argv;
+ {
+ #define SECS_PER_DAY (60 * 60 * 24)
+ #define SECS_PER_WEEK (SECS_PER_DAY * 7)
+ #define SECS_PER_MONTH ((int)(SECS_PER_DAY * 30.5))
+ #define SECS_PER_YEAR (SECS_PER_DAY * 365)
+ register char *p;
+ char buf[256];
+ int n = 0, value, mdy_index = 0;
+ long t;
+ struct tm *today;
+
+ (void) argv_to_string(buf, argv);
+ p = buf;
+ (void) time (&t); /* get current time in seconds and subtract new values */
+ if (*p == '-')
+ before = TRUE;
+ else if (*p == '+')
+ after = TRUE;
+ skipspaces(before || after);
+ while (*p) {
+ if (!isdigit(*p))
+ break; /* really a syntax error, but it could be other pick ars */
+ p = my_atoi(p, &value); /* get 1 or more digits */
+ skipspaces(0); /* 0 or more spaces */
+ switch (lower(*p)) { /* d, m, or y */
+ when 'd' : t -= value * SECS_PER_DAY;
+ when 'w' : t -= value * SECS_PER_WEEK;
+ when 'm' : t -= value * SECS_PER_MONTH;
+ when 'y' : t -= value * SECS_PER_YEAR;
+ otherwise: return -1;
+ }
+ for (p++; Lower(*p) >= 'a' && *p <= 'z'; p++)
+ ; /* skip the rest of this token */
+ while (*p == ',' || isspace(*p))
+ ; /* 0 or more whitespaces or commas */
+ }
+ today = localtime(&t);
+ mdy[0] = today->tm_mon;
+ mdy[1] = today->tm_mday;
+ mdy[2] = today->tm_year;
+
+ /* Count the number of args parsed */
+ for (n = 0; p > buf && *argv; n++)
+ p -= (strlen(*argv++)+1);
+ Debug("parsed %d args\n", n);
+ return n;
}
*** OLD/print.c Thu May 12 13:52:13 1988
--- print.c Thu Apr 28 21:47:54 1988
***************
*** 1,4 ****
-
/* @(#)print.c 2.4 (c) copyright 10/15/86 (Dan Heller) */
#include "mush.h"
--- 1,3 ----
***************
*** 185,188 ****
{
print("");
}
-
--- 184,186 ----
*** OLD/strings.c Thu Apr 7 09:51:46 1988
--- strings.c Tue Apr 26 19:01:20 1988
***************
*** 219,229 ****
}
#ifdef SYSV
char *
! Sprintf(buf, fmt, args)
register char *buf, *fmt;
{
! vsprintf(buf, fmt, &args);
return buf;
}
#endif /* SYSV */
--- 219,247 ----
}
#ifdef SYSV
+ #include <varargs.h>
char *
! Sprintf(buf, fmt, va_alist)
register char *buf, *fmt;
+ va_dcl
{
! va_list ap;
! #ifdef VPRINTF
! va_start(ap);
! (void) vsprintf(buf, fmt, ap);
! va_end(ap);
! #else
! {
! FILE foo;
! foo._cnt = BUFSIZ;
! foo._base = foo._ptr = buf; /* may have to be cast (unsigned char *) */
! foo._flag = _IOWRT+_IOSTRG;
! va_start(ap);
! (void) _doprnt(fmt, ap, &foo);
! va_end(ap);
! *foo._ptr = '\0'; /* plant terminating null character */
! }
! #endif /* VPRINTF */
return buf;
}
#endif /* SYSV */
*** OLD/viewopts.c Sat Apr 2 21:12:48 1988
--- viewopts.c Wed May 11 20:48:41 1988
***************
*** 129,134 ****
--- 129,136 ----
"When reading messages, squeeze all blank lines into one." },
{ "top", "Lines", TOOL | TEXT,
"Number of lines to print of a message for the 'top' command." },
+ { "tmpdir", "Directory", TOOL | TEXT,
+ "Directory to use for temporary files used by Mush." },
{ "unix", NULL, TEXT,
"Non-mush commands are considered to be UNIX commands." },
{ "verify", NULL, TEXT,