(file) Return to System.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/System.cpp between version 1.30 and 1.31

version 1.30, 2005/10/05 20:45:21 version 1.31, 2005/10/12 20:08:10
Line 120 
Line 120 
 // Return the just the file name from the path into basename // Return the just the file name from the path into basename
 char *System::extract_file_name(const char *fullpath, char *basename) char *System::extract_file_name(const char *fullpath, char *basename)
 { {
   char *p;  
   char buff[2048];  
   if (fullpath == NULL)   if (fullpath == NULL)
     {     {
       basename[0] = '\0';       basename[0] = '\0';
       return basename;       return basename;
     }     }
   strcpy(buff, fullpath);  
   for(p = buff + strlen(buff); p >= buff; p--)    for (const char* p = fullpath + strlen(fullpath) - 1; p >= fullpath; p--)
     {     {
       if (*p == '\\' || *p == '/')       if (*p == '\\' || *p == '/')
         {         {
Line 136 
Line 134 
           return basename;           return basename;
         }         }
     }     }
   
   strcpy(basename, fullpath);   strcpy(basename, fullpath);
   return basename;   return basename;
 } }


Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2