include aculib in cleanup
[unix-history] / usr / src / usr.bin / mail / head.c
index bb7922c..78353f3 100644 (file)
@@ -8,7 +8,7 @@
  * Routines for processing and detecting headlines.
  */
 
  * Routines for processing and detecting headlines.
  */
 
-static char *SccsId = "@(#)head.c      1.1 %G%";
+static char *SccsId = "@(#)head.c      2.2 %G%";
 
 /*
  * See if the passed line buffer is a mail header.
 
 /*
  * See if the passed line buffer is a mail header.
@@ -24,7 +24,7 @@ ishead(linebuf)
        char parbuf[BUFSIZ];
 
        cp = linebuf;
        char parbuf[BUFSIZ];
 
        cp = linebuf;
-       if (!isname("From ", cp, 5))
+       if (strncmp("From ", cp, 5) != 0)
                return(0);
        parse(cp, &hl, parbuf);
        if (hl.l_from == NOSTR || hl.l_date == NOSTR) {
                return(0);
        parse(cp, &hl, parbuf);
        if (hl.l_from == NOSTR || hl.l_date == NOSTR) {
@@ -82,7 +82,7 @@ parse(line, hl, pbuf)
        dp = nextword(cp, word);
        if (!equal(word, ""))
                hl->l_from = copyin(word, &sp);
        dp = nextword(cp, word);
        if (!equal(word, ""))
                hl->l_from = copyin(word, &sp);
-       if (isname(dp, "tty", 3)) {
+       if (strncmp(dp, "tty", 3) == 0) {
                cp = nextword(dp, word);
                hl->l_tty = copyin(word, &sp);
                if (cp != NOSTR)
                cp = nextword(dp, word);
                hl->l_tty = copyin(word, &sp);
                if (cp != NOSTR)
@@ -117,28 +117,6 @@ copyin(src, space)
        return(top);
 }
 
        return(top);
 }
 
-/*
- * See if the two passed strings agree in the first n characters.
- * Return true if they do, gnu.
- */
-
-isname(as1, as2, acount)
-       char *as1, *as2;
-{
-       register char *s1, *s2;
-       register count;
-
-       s1 = as1;
-       s2 = as2;
-       count = acount;
-       if (count > 0)
-               do
-                       if (*s1++ != *s2++)
-                               return(0);
-               while (--count);
-       return(1);
-}
-
 /*
  * Test to see if the passed string is a ctime(3) generated
  * date string as documented in the manual.  The template
 /*
  * Test to see if the passed string is a ctime(3) generated
  * date string as documented in the manual.  The template