You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ro...@locus.apache.org on 2000/02/07 21:04:47 UTC

cvs commit: xml-xerces/c/src/framework LocalFileInputSource.cpp

roddey      00/02/07 12:04:47

  Modified:    c/src/framework LocalFileInputSource.cpp
  Log:
  Don't weave base and relative paths unless relative part is really relative.
  
  Revision  Changes    Path
  1.3       +18 -7     xml-xerces/c/src/framework/LocalFileInputSource.cpp
  
  Index: LocalFileInputSource.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/framework/LocalFileInputSource.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LocalFileInputSource.cpp	2000/02/06 07:47:46	1.2
  +++ LocalFileInputSource.cpp	2000/02/07 20:04:47	1.3
  @@ -70,18 +70,29 @@
                                               , const XMLCh* const relativePath)
   {
       //
  -    //  Weave the two paths together in order to base the relative one
  -    //  off of the base one. Assume that the base path is a full path to
  -    //  a real file, so we throw off the name right off the bat.
  +    //  If the relative part is really relative, then weave it together
  +    //  with the base path. If not, just take the relative path as the
  +    //  entire path.
       //
  -    XMLCh* tmpBuf = XMLPlatformUtils::weavePaths(basePath, relativePath);
  -    setSystemId(tmpBuf);
  -    delete [] tmpBuf;
  +    if (XMLPlatformUtils::isRelative(relativePath))
  +    {
  +        XMLCh* tmpBuf = XMLPlatformUtils::weavePaths(basePath, relativePath);
  +        setSystemId(tmpBuf);
  +        delete [] tmpBuf;
  +    }
  +     else
  +    {
  +        setSystemId(relativePath);
  +    }
   }
   
   LocalFileInputSource::LocalFileInputSource(const XMLCh* const filePath)
   {
  -    // Complete the path before storing it
  +    //
  +    //  If the path is relative, then complete it acording to the current
  +    //  working directory rules of the current platform. Else, just take
  +    //  it as is.
  +    //
       if (XMLPlatformUtils::isRelative(filePath))
       {
           XMLCh* tmpBuf = XMLPlatformUtils::getFullPath(filePath);