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

Diff for /src/usr.bin/cvs/file.c between version 1.50 and 1.51

version 1.50, 2005/01/11 00:01:14 version 1.51, 2005/01/12 20:10:09
Line 32 
Line 32 
 #include <errno.h>  #include <errno.h>
 #include <stdio.h>  #include <stdio.h>
 #include <fcntl.h>  #include <fcntl.h>
   #include <libgen.h>
 #include <dirent.h>  #include <dirent.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <unistd.h>  #include <unistd.h>
Line 826 
Line 827 
 CVSFILE*  CVSFILE*
 cvs_file_alloc(const char *path, u_int type)  cvs_file_alloc(const char *path, u_int type)
 {  {
         size_t len;  
         char pbuf[MAXPATHLEN];  
         const char *fnp;  
         CVSFILE *cfp;          CVSFILE *cfp;
         struct cvs_dir *ddat;          struct cvs_dir *ddat;
   
Line 839 
Line 837 
         }          }
         memset(cfp, 0, sizeof(*cfp));          memset(cfp, 0, sizeof(*cfp));
   
         /* ditch trailing slashes */          cfp->cf_name = cvs_file_getname(basename(path));
         strlcpy(pbuf, path, sizeof(pbuf));  
         len = strlen(pbuf);  
         while (pbuf[len - 1] == '/')  
                 pbuf[--len] = '\0';  
   
         fnp = strrchr(path, '/');  
         if (fnp == NULL)  
                 fnp = path;  
         else  
                 fnp++;  
   
         cfp->cf_name = cvs_file_getname(fnp);  
         if (cfp->cf_name == NULL) {          if (cfp->cf_name == NULL) {
                 cvs_log(LP_ERR, "failed to get file name from table");                  cvs_log(LP_ERR, "failed to get file name from table");
                 return (NULL);                  return (NULL);

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.51