[BACK]Return to aux.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mail

Diff for /src/usr.bin/mail/Attic/aux.c between version 1.6 and 1.7

version 1.6, 1997/07/13 23:53:56 version 1.7, 1997/07/14 00:24:24
Line 62 
Line 62 
         char *new;          char *new;
         int size = strlen(str) + 1;          int size = strlen(str) + 1;
   
         if ((new = salloc(size)) != NOSTR)          if ((new = salloc(size)) != NULL)
                 (void)memcpy(new, str, size);                  (void)memcpy(new, str, size);
         return(new);          return(new);
 }  }
Line 78 
Line 78 
         int newsize = strlen(str) + 1;          int newsize = strlen(str) + 1;
         int oldsize = old ? strlen(old) + 1 : 0;          int oldsize = old ? strlen(old) + 1 : 0;
   
         if ((new = salloc(newsize + oldsize)) != NOSTR) {          if ((new = salloc(newsize + oldsize)) != NULL) {
                 if (oldsize) {                  if (oldsize) {
                         (void)memcpy(new, old, oldsize);                          (void)memcpy(new, old, oldsize);
                         new[oldsize - 1] = ' ';                          new[oldsize - 1] = ' ';
Line 159 
Line 159 
 {  {
         register char **ap;          register char **ap;
   
         for (ap = argv; *ap++ != NOSTR;)          for (ap = argv; *ap++ != NULL;)
                 ;                  ;
         return(ap - argv - 1);          return(ap - argv - 1);
 }  }
   
 /*  /*
  * Return the desired header line from the passed message   * Return the desired header line from the passed message
  * pointer (or NOSTR if the desired header field is not available).   * pointer (or NULL if the desired header field is not available).
  */   */
 char *  char *
 hfield(field, mp)  hfield(field, mp)
Line 177 
Line 177 
         char linebuf[LINESIZE];          char linebuf[LINESIZE];
         register int lc;          register int lc;
         register char *hfield;          register char *hfield;
         char *colon, *oldhfield = NOSTR;          char *colon, *oldhfield = NULL;
   
         ibuf = setinput(mp);          ibuf = setinput(mp);
         if ((lc = mp->m_lines - 1) < 0)          if ((lc = mp->m_lines - 1) < 0)
                 return(NOSTR);                  return(NULL);
         if (readline(ibuf, linebuf, LINESIZE) < 0)          if (readline(ibuf, linebuf, LINESIZE) < 0)
                 return(NOSTR);                  return(NULL);
         while (lc > 0) {          while (lc > 0) {
                 if ((lc = gethfield(ibuf, linebuf, lc, &colon)) < 0)                  if ((lc = gethfield(ibuf, linebuf, lc, &colon)) < 0)
                         return(oldhfield);                          return(oldhfield);
Line 318 
Line 318 
         FILE *fi;          FILE *fi;
         char *cp;          char *cp;
   
         if ((cp = expand(*arglist)) == NOSTR)          if ((cp = expand(*arglist)) == NULL)
                 return(1);                  return(1);
         if ((fi = Fopen(cp, "r")) == NULL) {          if ((fi = Fopen(cp, "r")) == NULL) {
                 warn(cp);                  warn(cp);
Line 464 
Line 464 
         int gotlt, lastsp;          int gotlt, lastsp;
         char nbuf[BUFSIZ];          char nbuf[BUFSIZ];
   
         if (name == NOSTR)          if (name == NULL)
                 return(NOSTR);                  return(NULL);
         if (strchr(name, '(') == NOSTR && strchr(name, '<') == NOSTR          if (strchr(name, '(') == NULL && strchr(name, '<') == NULL
             && strchr(name, ' ') == NOSTR)              && strchr(name, ' ') == NULL)
                 return(name);                  return(name);
         gotlt = 0;          gotlt = 0;
         lastsp = 0;          lastsp = 0;
Line 573 
Line 573 
         register FILE *ibuf;          register FILE *ibuf;
         int first = 1;          int first = 1;
   
         if ((cp = hfield("from", mp)) != NOSTR)          if ((cp = hfield("from", mp)) != NULL)
                 return(cp);                  return(cp);
         if (reptype == 0 && (cp = hfield("sender", mp)) != NOSTR)          if (reptype == 0 && (cp = hfield("sender", mp)) != NULL)
                 return(cp);                  return(cp);
         ibuf = setinput(mp);          ibuf = setinput(mp);
         namebuf[0] = '\0';          namebuf[0] = '\0';

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7