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 bu...@apache.org on 2001/03/19 15:17:18 UTC

[Bug 1021] New - XMLURL.cpp doesn't handle UNC paths correctly

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1021

*** shadow/1021	Mon Mar 19 06:17:18 2001
--- shadow/1021.tmp.5091	Mon Mar 19 06:17:18 2001
***************
*** 0 ****
--- 1,48 ----
+ +============================================================================+
+ | XMLURL.cpp doesn't handle UNC paths correctly                              |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 1021                        Product: Xerces-C                |
+ |       Status: NEW                         Version: 1.4                     |
+ |   Resolution:                            Platform: PC                      |
+ |     Severity: Normal                   OS/Version: Windows 9x              |
+ |     Priority:                           Component: Utilities               |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: xerces-c-dev@xml.apache.org                                  |
+ |  Reported By: John_Roper@iOra.com                                          |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL: file:///server1/fred.xml                                     |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ Accessing an XML file using the file "protocol" and a UNC path fails to open 
+ the file. There is already analagous code to fix the leading / in drive based 
+ windows paths, and the fix is included here to extend this to UNC paths.
+ 
+             //
+             //  We have to play a little trick here. If its really a Windows
+             //  style fully qualified path, we have to toss the leading /
+             //  character.
+             //
+             const XMLCh* realPath = fPath;
+             if (*fPath == chForwardSlash)
+             {
+                 if (XMLString::stringLen(fPath) > 3)
+                 {
+                     if (*(fPath + 2) == chColon)
+                     {
+                         const XMLCh chDrive = *(fPath + 1);
+                         if (((chDrive >= chLatin_A) && (chDrive <= chLatin_Z))
+                         ||  ((chDrive >= chLatin_a) && (chDrive <= chLatin_z)))
+                         {
+                             realPath = fPath + 1;
+                         }
+                     }
+ 					//	Similarly for UNC paths
+ 					if ( *(fPath + 1) == *(fPath + 2) &&
+ 						 (*(fPath + 1) == 
+ chForwardSlash || *(fPath + 1) == chBackSlash) )
+ 					{
+ 						realPath = fPath + 1;
+ 					}
+                 }
+             }

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