changed to version 2.1
[unix-history] / usr / src / usr.bin / mail / cmd1.c
index 82f6e7c..fe84684 100644 (file)
@@ -8,7 +8,7 @@
  * User commands.
  */
 
  * User commands.
  */
 
-static char *SccsId = "@(#)cmd1.c      1.7 %G%";
+static char *SccsId = "@(#)cmd1.c      1.9 %G%";
 
 /*
  * Print the current active headings.
 
 /*
  * Print the current active headings.
@@ -149,6 +149,8 @@ printhead(mesg)
                dispc = 'N';
        if ((mp->m_flag & (MREAD|MNEW)) == 0)
                dispc = 'U';
                dispc = 'N';
        if ((mp->m_flag & (MREAD|MNEW)) == 0)
                dispc = 'U';
+       if (mp->m_flag & MBOX)
+               dispc = 'M';
        parse(headline, &hl, pbuf);
        sprintf(wcount, " %d/%d", mp->m_lines, mp->m_size);
        s = strlen(wcount);
        parse(headline, &hl, pbuf);
        sprintf(wcount, " %d/%d", mp->m_lines, mp->m_size);
        s = strlen(wcount);
@@ -222,7 +224,7 @@ type(msgvec)
                        pclose(obuf);
                        pipef = NULL;
                }
                        pclose(obuf);
                        pipef = NULL;
                }
-               signal(SIGPIPE, SIG_DFL);
+               sigset(SIGPIPE, SIG_DFL);
                return(0);
        }
        if (intty && outtty && (cp = value("crt")) != NOSTR) {
                return(0);
        }
        if (intty && outtty && (cp = value("crt")) != NOSTR) {
@@ -236,7 +238,7 @@ type(msgvec)
                        }
                        else {
                                pipef = obuf;
                        }
                        else {
                                pipef = obuf;
-                               signal(SIGPIPE, brokpipe);
+                               sigset(SIGPIPE, brokpipe);
                        }
                }
        }
                        }
                }
        }
@@ -251,7 +253,7 @@ type(msgvec)
                pclose(obuf);
                pipef = NULL;
        }
                pclose(obuf);
                pipef = NULL;
        }
-       signal(SIGPIPE, SIG_DFL);
+       sigset(SIGPIPE, SIG_DFL);
        return(0);
 }
 
        return(0);
 }
 
@@ -263,8 +265,8 @@ type(msgvec)
 brokpipe()
 {
 
 brokpipe()
 {
 
-       signal(SIGPIPE, SIG_IGN);
        longjmp(pipestop, 1);
        longjmp(pipestop, 1);
+       sigrelse(SIGPIPE);
 }
 
 /*
 }
 
 /*
@@ -344,3 +346,20 @@ stouch(msgvec)
        }
        return(0);
 }
        }
        return(0);
 }
+
+/*
+ * Make sure all passed messages get mboxed.
+ */
+
+mboxit(msgvec)
+       int msgvec[];
+{
+       register int *ip;
+
+       for (ip = msgvec; *ip != 0; ip++) {
+               dot = &message[*ip-1];
+               dot->m_flag |= MTOUCH|MBOX;
+               dot->m_flag &= ~MPRESERVE;
+       }
+       return(0);
+}