setup home directory for globbing
[unix-history] / usr / src / usr.bin / mail / lex.c
index 8938a73..6c7f331 100644 (file)
@@ -8,7 +8,7 @@
  * Lexical processing of commands.
  */
 
  * Lexical processing of commands.
  */
 
-static char *SccsId = "@(#)lex.c       2.8 %G%";
+static char *SccsId = "@(#)lex.c       2.11 %G%";
 
 char   *prompt = "& ";
 
 
 char   *prompt = "& ";
 
@@ -28,13 +28,8 @@ setfile(name, isedit)
        static char efile[128];
        extern char tempMesg[];
 
        static char efile[128];
        extern char tempMesg[];
 
-       if ((ibuf = fopen(name, "r")) == NULL) {
-               if (isedit)
-                       perror(name);
-               else
-                       printf("No mail for %s\n", myname);
+       if ((ibuf = fopen(name, "r")) == NULL)
                return(-1);
                return(-1);
-       }
 
        /*
         * Looks like all will be well.  We must now relinquish our
 
        /*
         * Looks like all will be well.  We must now relinquish our
@@ -547,11 +542,11 @@ announce(pr)
        int vec[2], mdot;
        extern char *version;
 
        int vec[2], mdot;
        extern char *version;
 
+       if (pr && value("quiet") == NOSTR)
+               printf(greeting, version);
        mdot = newfileinfo();
        vec[0] = mdot;
        vec[1] = 0;
        mdot = newfileinfo();
        vec[0] = mdot;
        vec[1] = 0;
-       if (pr && value("quiet") == NOSTR)
-               printf(greeting, version);
        dot = &message[mdot - 1];
        if (msgCount > 0 && !noheader) {
                inithdr++;
        dot = &message[mdot - 1];
        if (msgCount > 0 && !noheader) {
                inithdr++;
@@ -567,7 +562,7 @@ announce(pr)
 newfileinfo()
 {
        register struct message *mp;
 newfileinfo()
 {
        register struct message *mp;
-       register int u, n, mdot;
+       register int u, n, mdot, d, s;
        char fname[BUFSIZ], zname[BUFSIZ], *ename;
 
        for (mp = &message[0]; mp < &message[msgCount]; mp++)
        char fname[BUFSIZ], zname[BUFSIZ], *ename;
 
        for (mp = &message[0]; mp < &message[msgCount]; mp++)
@@ -581,11 +576,16 @@ newfileinfo()
                mdot = mp - &message[0] + 1;
        else
                mdot = 1;
                mdot = mp - &message[0] + 1;
        else
                mdot = 1;
+       s = d = 0;
        for (mp = &message[0], n = 0, u = 0; mp < &message[msgCount]; mp++) {
                if (mp->m_flag & MNEW)
                        n++;
                if ((mp->m_flag & MREAD) == 0)
                        u++;
        for (mp = &message[0], n = 0, u = 0; mp < &message[msgCount]; mp++) {
                if (mp->m_flag & MNEW)
                        n++;
                if ((mp->m_flag & MREAD) == 0)
                        u++;
+               if (mp->m_flag & MDELETED)
+                       d++;
+               if (mp->m_flag & MSAVED)
+                       s++;
        }
        ename = mailname;
        if (getfold(fname) >= 0) {
        }
        ename = mailname;
        if (getfold(fname) >= 0) {
@@ -604,6 +604,10 @@ newfileinfo()
                printf(" %d new", n);
        if (u-n > 0)
                printf(" %d unread", u);
                printf(" %d new", n);
        if (u-n > 0)
                printf(" %d unread", u);
+       if (d > 0)
+               printf(" %d deleted", d);
+       if (s > 0)
+               printf(" %d saved", s);
        if (readonly)
                printf(" [Read only]");
        printf("\n");
        if (readonly)
                printf(" [Read only]");
        printf("\n");