You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Mathieu Champlon (JIRA)" <xe...@xml.apache.org> on 2009/06/29 22:46:47 UTC
[jira] Created: (XERCESC-1877) Windows paths are not handled
properly under cygwin
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: Bug
Components: Utilities
Affects Versions: 3.0.1
Environment: Cygwin with Xerces 3.0.1 built with ./configure and then make
Reporter: Mathieu Champlon
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 is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
[jira] Updated: (XERCESC-1877) Windows paths are not handled
properly under cygwin
Posted by "Boris Kolpackov (JIRA)" <xe...@xml.apache.org>.
[ https://issues.apache.org/jira/browse/XERCESC-1877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Boris Kolpackov updated XERCESC-1877:
-------------------------------------
Priority: Minor (was: Major)
Issue Type: Improvement (was: Bug)
Cygwin is a POSIX compatibility layer for Windows. Applications that target Cygwin are expected to use POSIX paths, not Windows paths. There are some applications that support both but that is rather the exception than the rule. I am therefore changing this issue's severity from Bug to Improvement.
If someone wants to add support (and to continue to maintain the added code) for both types of paths on Cygwin, then I believe it should be done by creating another implementation of the file manager interface instead of adding Cygwin-specific code to PosixFileMgr.
> 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 is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org
[jira] Commented: (XERCESC-1877) Windows paths are not handled
properly under cygwin
Posted by "Mathieu Champlon (JIRA)" <xe...@xml.apache.org>.
[ https://issues.apache.org/jira/browse/XERCESC-1877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12725974#action_12725974 ]
Mathieu Champlon commented on XERCESC-1877:
-------------------------------------------
I really believe this is a bug as Cygwin officially supports both path formats, see http://www.cygwin.com/cygwin-ug-net/using.html#using-pathnames for instance.
Anyway, I'll try and come up with a patch to add a CygwinFileMgr.
> 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 is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org