[ 
https://issues.apache.org/jira/browse/XERCESC-1877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16345893#comment-16345893
 ] 

Roger Leigh commented on XERCESC-1877:
--------------------------------------

>From the above cygwin documentation link: "Using native Win32 paths in Cygwin, 
>while often possible, is generally inadvisable. Those paths circumvent all 
>internal integrity checking and bypass the information given in the Cygwin 
>mount table."

 

I think the expectation is that you'll use POSIX paths like 
/cygdrive/c/tmp/personal.xml, since there are all sorts of subtle problems 
which can arise from using Win32 paths where POSIX paths are assumed.  In 
practice, the POSIX file manager works just fine.

 

I wonder if the behaviour can be simplified with C++17 std::filesystem::path 
when using a sufficiently modern system, since it would supersede both the 
POSIX and Win32 file managers.

> Windows paths are not handled properly under cygwin
> ---------------------------------------------------
>
>                 Key: XERCESC-1877
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1877
>             Project: Xerces-C++
>          Issue Type: Improvement
>          Components: Utilities
>    Affects Versions: 3.0.1
>         Environment: Cygwin with Xerces 3.0.1 built with ./configure and then 
> make
>            Reporter: Mathieu Champlon
>            Priority: Minor
>
> The Cygwin version of Xerces appears to be using the PosixFileMgr and 
> therefore isRelative returns false for a path starting with c: whereas it is 
> totally valid.
> To reproduce the issue copy samples/data/personal.xml (and personal.dtd) into 
> c:\tmp and run DOMCount as follows.
> $ pwd
> /cygdrive/c/Users/Mat/Desktop/dev/cpp/xerces-c-3.0.1/samples
> $ ls c:/tmp
> personal.dtd  personal.xml
> $ ./DOMCount.exe c:/tmp/personal.xml
> Fatal Error at file , line 0, char 0
>   Message: unable to open primary document entity 
> '/cygdrive/c/Users/Mat/Desktop
> /dev/cpp/xerces-c-3.0.1/samples/c:/tmp/personal.xml'
> Errors occurred, no output available
> ***
> Then I added the following lines taken from WindowsFileMgr to 
> PosixFileMgr::isRelative :
> #ifdef  __CYGWIN__
>     if (toCheck[1] == chColon)
>     {
>         if (((toCheck[0] >= chLatin_A) && (toCheck[0] <= chLatin_Z))
>         ||  ((toCheck[0] >= chLatin_a) && (toCheck[0] <= chLatin_z)))
>         {
>             return false;
>         }
>     }
> #endif
> With the following line at the top of PoxisFileMgr.cpp :
> #include <xercesc/util/XMLUniDefs.hpp>
> I recompiled the samples and ran DOMCount once again :
> $ ./DOMCount.exe c:/tmp/personal.xml
> c:/tmp/personal.xml: 67 ms (37 elems).
> The #ifdef __CYGWIN__ is probably not the way to go but it shows exactly 
> where the problem is.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org

Reply via email to