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

Diff for /src/usr.bin/whois/whois.c between version 1.11 and 1.12

version 1.11, 2000/07/12 18:01:57 version 1.12, 2001/10/04 19:28:58
Line 203 
Line 203 
         int flags;          int flags;
 {  {
         FILE *sfi, *sfo;          FILE *sfi, *sfo;
         char *buf, *p, *nhost;          char *buf, *p, *nhost, *nbuf = NULL;
         size_t len;          size_t len;
         int s, nomatch;          int s, nomatch;
         const char *reason = NULL;          const char *reason = NULL;
Line 242 
Line 242 
         while ((buf = fgetln(sfi, &len))) {          while ((buf = fgetln(sfi, &len))) {
                 if (buf[len - 2] == '\r')                  if (buf[len - 2] == '\r')
                         buf[len - 2] = '\0';                          buf[len - 2] = '\0';
                 else                  else if (buf[len - 1] == '\n')
                         buf[len - 1] = '\0';                          buf[len - 1] = '\0';
                   else {
                           nbuf = malloc(len + 1);
                           memcpy(nbuf, buf, len);
                           nbuf[len] = '\0';
                           buf = nbuf;
                   }
   
                 if ((flags & WHOIS_RECURSE) && !nhost &&                  if ((flags & WHOIS_RECURSE) && !nhost &&
                     (p = strstr(buf, "Whois Server: "))) {                      (p = strstr(buf, "Whois Server: "))) {
Line 264 
Line 270 
                 }                  }
                 (void)puts(buf);                  (void)puts(buf);
         }          }
           if (nbuf)
                   free(nbuf);
   
         /* Do second lookup as needed */          /* Do second lookup as needed */
         if (nomatch && !nhost) {          if (nomatch && !nhost) {

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12