document distributed with 4.2BSD
[unix-history] / usr / src / usr.bin / mail / head.c
index 78353f3..80cb5fd 100644 (file)
@@ -1,4 +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
+static char *sccsid = "@(#)head.c      5.2 (Berkeley) %G%";
+#endif not lint
 
 #include "rcv.h"
 
 
 #include "rcv.h"
 
@@ -8,8 +16,6 @@
  * Routines for processing and detecting headlines.
  */
 
  * Routines for processing and detecting headlines.
  */
 
-static char *SccsId = "@(#)head.c      2.2 %G%";
-
 /*
  * See if the passed line buffer is a mail header.
  * Return true if yes.  Note the extreme pains to
 /*
  * See if the passed line buffer is a mail header.
  * Return true if yes.  Note the extreme pains to
@@ -222,7 +228,14 @@ nextword(wp, wbuf)
        }
        cp2 = wbuf;
        while (!any(*cp, " \t") && *cp != '\0')
        }
        cp2 = wbuf;
        while (!any(*cp, " \t") && *cp != '\0')
-               *cp2++ = *cp++;
+               if (*cp == '"') {
+                       *cp2++ = *cp++;
+                       while (*cp != '\0' && *cp != '"')
+                               *cp2++ = *cp++;
+                       if (*cp == '"')
+                               *cp2++ = *cp++;
+               } else
+                       *cp2++ = *cp++;
        *cp2 = '\0';
        while (any(*cp, " \t"))
                cp++;
        *cp2 = '\0';
        while (any(*cp, " \t"))
                cp++;