Changeset 7d77faa in tol


Ignore:
Timestamp:
Jul 2, 2010, 7:54:54 AM (16 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
cfa4cf7
Parents:
0e7a82f
Message:

GetStandardAbsolutePath and GetAbsolutePath must ensure to return the last slash only if original path had it

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@2359 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/bbasic/dir.cpp

    r0e7a82f r7d77faa  
    430430    p = fp+GetFileName(p);
    431431  }
    432   if(endSlash)
     432  if(endSlash  && !IsSlash(p.Last()))
    433433  {
    434434    p += "/";
    … …  
    451451//--------------------------------------------------------------------
    452452{
    453 //if(!path_.HasName()) { return(path_); }
    454   /*
    455 #if defined(UNIX)
    456   char* ret_path = new char[PATH_MAX];
    457   if(realpath(path_.String(), ret_path)==NULL) {
    458     Error(path_+":"+strerror(errno));
    459   }
    460   return BText(ret_path);
    461 #else
    462   */
     453  bool endSlash = IsSlash(path_.Last());
    463454  BText path = GetAbsolutePath(path_);
    464455#ifdef WIN32
    … …  
    469460  path.Copy(fName,len);
    470461  path.Replace("\\","/");
     462#else
     463  //VBR: hay que buscar alguna forma de estandarizar el path en linux
     464  //eliminando cosas inútiles como /./
     465#endif
     466  if(endSlash && !IsSlash(path.Last()))
     467  {
     468    path += "/";
     469  }
    471470  return(path);
    472 #else
    473   return path;
    474 #endif
    475   /*
    476 #endif
    477   */
    478471}
    479472
Note: See TracChangeset for help on using the changeset viewer.