changed the way -N is handled
authorEdward Wang <edward@ucbvax.Berkeley.EDU>
Sat, 11 Jun 1988 18:32:30 +0000 (10:32 -0800)
committerEdward Wang <edward@ucbvax.Berkeley.EDU>
Sat, 11 Jun 1988 18:32:30 +0000 (10:32 -0800)
SCCS-vsn: usr.bin/mail/lex.c 5.10
SCCS-vsn: usr.bin/mail/glob.h 5.5
SCCS-vsn: usr.bin/mail/main.c 5.8

usr/src/usr.bin/mail/glob.h
usr/src/usr.bin/mail/lex.c
usr/src/usr.bin/mail/main.c

index c95b065..38275e9 100644 (file)
@@ -9,7 +9,7 @@
  * software without specific prior written permission. This software
  * is provided ``as is'' without express or implied warranty.
  *
  * software without specific prior written permission. This software
  * is provided ``as is'' without express or implied warranty.
  *
- *     @(#)glob.h      5.4 (Berkeley) %G%
+ *     @(#)glob.h      5.5 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -25,7 +25,6 @@ int   hflag;                          /* Sequence number for network -h */
 char   *rflag;                         /* -r address for network */
 char   *Tflag;                         /* -T temp file for netnews */
 char   nosrc;                          /* Don't source /usr/lib/Mail.rc */
 char   *rflag;                         /* -r address for network */
 char   *Tflag;                         /* -T temp file for netnews */
 char   nosrc;                          /* Don't source /usr/lib/Mail.rc */
-char   noheader;                       /* Suprress initial header listing */
 int    selfsent;                       /* User sent self something */
 int    senderr;                        /* An error while checking */
 int    edit;                           /* Indicates editing a file */
 int    selfsent;                       /* User sent self something */
 int    senderr;                        /* An error while checking */
 int    edit;                           /* Indicates editing a file */
index 1ed9ca2..0c1c1ca 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 #ifdef notdef
  */
 
 #ifdef notdef
-static char sccsid[] = "@(#)lex.c      5.9 (Berkeley) %G%";
+static char sccsid[] = "@(#)lex.c      5.10 (Berkeley) %G%";
 #endif /* notdef */
 
 #include "rcv.h"
 #endif /* notdef */
 
 #include "rcv.h"
@@ -575,20 +575,18 @@ stop(s)
  * give the message count, and print a header listing.
  */
 
  * give the message count, and print a header listing.
  */
 
-char   *greeting       = "Mail version %s.  Type ? for help.\n";
-
 announce(pr)
 {
        int vec[2], mdot;
        extern char *version;
 
        if (pr && value("quiet") == NOSTR)
 announce(pr)
 {
        int vec[2], mdot;
        extern char *version;
 
        if (pr && value("quiet") == NOSTR)
-               printf(greeting, version);
+               printf( "Mail version %s.  Type ? for help.\n", version);
        mdot = newfileinfo();
        vec[0] = mdot;
        vec[1] = 0;
        dot = &message[mdot - 1];
        mdot = newfileinfo();
        vec[0] = mdot;
        vec[1] = 0;
        dot = &message[mdot - 1];
-       if (msgCount > 0 && !noheader) {
+       if (msgCount > 0 && value("noheader") == NOSTR) {
                inithdr++;
                headers(vec);
                inithdr = 0;
                inithdr++;
                headers(vec);
                inithdr = 0;
index 571de77..7847379 100644 (file)
@@ -17,7 +17,7 @@ char copyright[] =
 #endif /* notdef */
 
 #ifdef notdef
 #endif /* notdef */
 
 #ifdef notdef
-static char sccsid[] = "@(#)main.c     5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     5.8 (Berkeley) %G%";
 #endif /* notdef */
 
 #include "rcv.h"
 #endif /* notdef */
 
 #include "rcv.h"
@@ -159,7 +159,7 @@ main(argc, argv)
                         * getopt() can't handle optional arguments, so here
                         * is an ugly hack to get around it.
                         */
                         * getopt() can't handle optional arguments, so here
                         * is an ugly hack to get around it.
                         */
-                       if ((argv[optind]) && (argv[optind][0] != '-')) 
+                       if ((argv[optind]) && (argv[optind][0] != '-'))
                                ef = argv[optind++];
                        else
                                ef = mbox;
                                ef = argv[optind++];
                        else
                                ef = mbox;
@@ -174,7 +174,7 @@ main(argc, argv)
                        /*
                         * Avoid initial header printing.
                         */
                        /*
                         * Avoid initial header printing.
                         */
-                       noheader++;
+                       assign("noheader", "");
                        break;
                case 'v':
                        /*
                        break;
                case 'v':
                        /*
@@ -212,7 +212,7 @@ Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...\n\
                        exit(1);
                }
        }
                        exit(1);
                }
        }
-       for (i = optind; (argv[i]) && (*argv[i] != '-'); i++) 
+       for (i = optind; (argv[i]) && (*argv[i] != '-'); i++)
                to = cat(to, nalloc(argv[i]));
        for (; argv[i]; i++)
                smopts = cat(smopts, nalloc(argv[i]));
                to = cat(to, nalloc(argv[i]));
        for (; argv[i]; i++)
                smopts = cat(smopts, nalloc(argv[i]));
@@ -273,14 +273,12 @@ Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...\n\
                        fprintf(stderr, "No mail for %s\n", myname);
                exit(1);
        }
                        fprintf(stderr, "No mail for %s\n", myname);
                exit(1);
        }
-       if (!noheader && value("noheader") == NOSTR) {
-               if (setjmp(hdrjmp) == 0) {
-                       if ((prevint = signal(SIGINT, SIG_IGN)) != SIG_IGN)
-                               signal(SIGINT, hdrstop);
-                       announce(!0);
-                       fflush(stdout);
-                       signal(SIGINT, prevint);
-               }
+       if (setjmp(hdrjmp) == 0) {
+               if ((prevint = signal(SIGINT, SIG_IGN)) != SIG_IGN)
+                       signal(SIGINT, hdrstop);
+               announce(!0);
+               fflush(stdout);
+               signal(SIGINT, prevint);
        }
        if (!edit && msgCount == 0) {
                printf("No mail\n");
        }
        if (!edit && msgCount == 0) {
                printf("No mail\n");