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

Diff for /src/usr.bin/rcs/rcsprog.c between version 1.76 and 1.77

version 1.76, 2006/03/16 04:04:57 version 1.77, 2006/03/18 03:41:54
Line 288 
Line 288 
          * This ensures that there is at least one suffix for strsep().           * This ensures that there is at least one suffix for strsep().
          */           */
         if (strcmp(rcs_suffixes, "") == 0) {          if (strcmp(rcs_suffixes, "") == 0) {
                 if ((ret = strdup(rcspath)) == NULL);                  ret = xstrdup(rcspath);
                         fatal("out of memory");  
                 return (ret);                  return (ret);
         }          }
   
Line 299 
Line 298 
          * does, return that string.  Otherwise return path with first           * does, return that string.  Otherwise return path with first
          * extension.           * extension.
          */           */
         if ((suffixes = strdup(rcs_suffixes)) == NULL)          suffixes = xstrdup(rcs_suffixes);
                 fatal("out of memory");  
         for (ret = NULL, next = suffixes; (ext = strsep(&next, "/")) != NULL;) {          for (ret = NULL, next = suffixes; (ext = strsep(&next, "/")) != NULL;) {
                 char fpath[MAXPATHLEN];                  char fpath[MAXPATHLEN];
   
Line 316 
Line 314 
                         continue;                          continue;
   
                 if (stat(fpath, &sb) == 0) {                  if (stat(fpath, &sb) == 0) {
                         if ((ret = strdup(fpath)) == NULL)                          ret = xstrdup(fpath);
                                 fatal("out of memory");  
                         break;                          break;
                 }                  }
         }          }
Line 332 
Line 329 
                  * XXX - We shouldn't need to do strsep again,                   * XXX - We shouldn't need to do strsep again,
                  * suffixes should now be NUL separated.                   * suffixes should now be NUL separated.
                  */                   */
                 if ((suffixes = strdup(rcs_suffixes)) == NULL)                  next = suffixes = xstrdup(rcs_suffixes);
                         fatal("out of memory");  
                 next = suffixes;  
                 /* Get first extension again. */                  /* Get first extension again. */
                 if ((ext = strsep(&next, "/")) == NULL) {                  if ((ext = strsep(&next, "/")) == NULL) {
                         xfree(suffixes);                          xfree(suffixes);
Line 344 
Line 339 
                         xfree(suffixes);                          xfree(suffixes);
                         return (NULL);                          return (NULL);
                 }                  }
                 if ((ret = strdup(rcspath)) == NULL)                  ret = xstrdup(rcspath);
                         fatal("out of memory");  
                 xfree(suffixes);                  xfree(suffixes);
         }          }
   

Legend:
Removed from v.1.76  
changed lines
  Added in v.1.77