projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
date and time created 87/02/15 16:03:36 by lepreau
[unix-history]
/
usr
/
src
/
usr.bin
/
mail
/
collect.c
diff --git
a/usr/src/usr.bin/mail/collect.c
b/usr/src/usr.bin/mail/collect.c
index
267ae74
..
954e31c
100644
(file)
--- a/
usr/src/usr.bin/mail/collect.c
+++ b/
usr/src/usr.bin/mail/collect.c
@@
-1,6
+1,12
@@
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved. The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
#ifndef lint
#ifndef lint
-static char
sccsid[] = "@(#)collect.c 2.15
(Berkeley) %G%";
-#endif
+static char
*sccsid = "@(#)collect.c 5.2
(Berkeley) %G%";
+#endif
not lint
/*
* Mail -- a mail program
/*
* Mail -- a mail program
@@
-48,6
+54,7
@@
collect(hp)
extern char tempMail[];
int notify();
extern collintsig(), collhupsig();
extern char tempMail[];
int notify();
extern collintsig(), collhupsig();
+ char getsub;
noreset++;
ibuf = obuf = NULL;
noreset++;
ibuf = obuf = NULL;
@@
-58,9
+65,9
@@
collect(hp)
hadintr = 0;
# ifdef VMUNIX
if ((savesig = sigset(SIGINT, SIG_IGN)) != SIG_IGN)
hadintr = 0;
# ifdef VMUNIX
if ((savesig = sigset(SIGINT, SIG_IGN)) != SIG_IGN)
- sigset(SIGINT, hf ? intack : collrub), sigblock(mask(SIGINT));
+ sigset(SIGINT, hf ? intack : collrub), sigblock(
sig
mask(SIGINT));
if ((savehup = sigset(SIGHUP, SIG_IGN)) != SIG_IGN)
if ((savehup = sigset(SIGHUP, SIG_IGN)) != SIG_IGN)
- sigset(SIGHUP, collrub), sigblock(mask(SIGHUP));
+ sigset(SIGHUP, collrub), sigblock(
sig
mask(SIGHUP));
savecont = sigset(SIGCONT, collcont);
# else VMUNIX
savesig = signal(SIGINT, SIG_IGN);
savecont = sigset(SIGCONT, collcont);
# else VMUNIX
savesig = signal(SIGINT, SIG_IGN);
@@
-89,21
+96,19
@@
collect(hp)
*/
t = GTO|GSUBJECT|GCC|GNL;
*/
t = GTO|GSUBJECT|GCC|GNL;
-
c
= 0;
+
getsub
= 0;
if (intty && sflag == NOSTR && hp->h_subject == NOSTR && value("ask"))
if (intty && sflag == NOSTR && hp->h_subject == NOSTR && value("ask"))
- t &= ~GNL,
c
++;
+ t &= ~GNL,
getsub
++;
if (hp->h_seq != 0) {
puthead(hp, stdout, t);
fflush(stdout);
}
if (hp->h_seq != 0) {
puthead(hp, stdout, t);
fflush(stdout);
}
- if (c)
- grabh(hp, GSUBJECT);
escape = ESCAPE;
if ((cp = value("escape")) != NOSTR)
escape = *cp;
eof = 0;
for (;;) {
escape = ESCAPE;
if ((cp = value("escape")) != NOSTR)
escape = *cp;
eof = 0;
for (;;) {
- int omask = sigblock(0) &~ (
mask(SIGINT)|
mask(SIGHUP));
+ int omask = sigblock(0) &~ (
sigmask(SIGINT)|sig
mask(SIGHUP));
setjmp(coljmp);
# ifdef VMUNIX
setjmp(coljmp);
# ifdef VMUNIX
@@
-114,7
+119,12
@@
collect(hp)
if (savehup != SIG_IGN)
signal(SIGHUP, collhupsig);
# endif VMUNIX
if (savehup != SIG_IGN)
signal(SIGHUP, collhupsig);
# endif VMUNIX
- flush();
+ fflush(stdout);
+ if (getsub) {
+ grabh(hp, GSUBJECT);
+ getsub = 0;
+ continue;
+ }
if (readline(stdin, linebuf) <= 0) {
if (intty && value("ignoreeof") != NOSTR) {
if (++eof > 35)
if (readline(stdin, linebuf) <= 0) {
if (intty && value("ignoreeof") != NOSTR) {
if (++eof > 35)
@@
-276,7
+286,7
@@
collect(hp)
break;
}
printf("\"%s\" ", cp);
break;
}
printf("\"%s\" ", cp);
- f
lush(
);
+ f
flush(stdout
);
lc = 0;
cc = 0;
while (readline(fbuf, linebuf) > 0) {
lc = 0;
cc = 0;
while (readline(fbuf, linebuf) > 0) {
@@
-390,7
+400,6
@@
collect(hp)
ibuf = newi;
printf("(continue)\n");
break;
ibuf = newi;
printf("(continue)\n");
break;
- break;
}
}
eofl:
}
}
eofl:
@@
-796,8
+805,8
@@
collrub(s)
if (s == SIGINT && hadintr == 0) {
hadintr++;
if (s == SIGINT && hadintr == 0) {
hadintr++;
-
clrbuf
(stdout);
-
printf(
"\n(Interrupt -- one more to kill letter)\n");
+
fflush
(stdout);
+
fprintf(stderr,
"\n(Interrupt -- one more to kill letter)\n");
longjmp(coljmp, 1);
}
fclose(newo);
longjmp(coljmp, 1);
}
fclose(newo);