Made recognition of Status: header field slightly more reliable.
authorKurt A. Shoens <kurt@ucbvax.Berkeley.EDU>
Fri, 30 Jul 1982 00:13:39 +0000 (16:13 -0800)
committerKurt A. Shoens <kurt@ucbvax.Berkeley.EDU>
Fri, 30 Jul 1982 00:13:39 +0000 (16:13 -0800)
SCCS-vsn: usr.bin/mail/send.c 2.4

usr/src/usr.bin/mail/send.c

index 54c128b..b87b841 100644 (file)
@@ -12,7 +12,7 @@
  * Mail to others.
  */
 
  * Mail to others.
  */
 
-static char *SccsId = "@(#)send.c      2.3 %G%";
+static char *SccsId = "@(#)send.c      2.4 %G%";
 
 /*
  * Send message described by the passed pointer to the
 
 /*
  * Send message described by the passed pointer to the
@@ -20,7 +20,6 @@ static char *SccsId = "@(#)send.c     2.3 %G%";
  * the number of lines written.  Adjust the status: field
  * if need be.  If doign is set, suppress ignored header fields.
  */
  * the number of lines written.  Adjust the status: field
  * if need be.  If doign is set, suppress ignored header fields.
  */
-
 send(mailp, obuf, doign)
        struct message *mailp;
        FILE *obuf;
 send(mailp, obuf, doign)
        struct message *mailp;
        FILE *obuf;
@@ -91,18 +90,6 @@ send(mailp, obuf, doign)
                                goto writeit;
                        }
                        infld++;
                                goto writeit;
                        }
                        infld++;
-                       /*
-                        * We are looking at a header line.
-                        * See if it is the status: field,
-                        * and if it is, print the real status: field
-                        */
-                       if (icisname(line, "status", 6)) {
-                               if (dostat) {
-                                       statusput(mailp, obuf, doign);
-                                       dostat = 0;
-                               }
-                               continue;
-                       }
                        /*
                         * Pick up the header field.
                         * If it is an ignored field and
                        /*
                         * Pick up the header field.
                         * If it is an ignored field and
@@ -115,6 +102,17 @@ send(mailp, obuf, doign)
                        *cp2 = 0;
                        if (doign && isign(field))
                                continue;
                        *cp2 = 0;
                        if (doign && isign(field))
                                continue;
+                       /*
+                        * If the field is "status," go compute and print the
+                        * real Status: field
+                        */
+                       if (icequal(field, "status")) {
+                               if (dostat) {
+                                       statusput(mailp, obuf, doign);
+                                       dostat = 0;
+                               }
+                               continue;
+                       }
                }
 writeit:
                fputs(line, obuf);
                }
 writeit:
                fputs(line, obuf);