mrglavas    2004/11/17 12:02:42

  Modified:    java/src/org/apache/xerces/impl XMLEntityManager.java
  Log:
  When fixing up windows file names transform C:blah into file:///C:/blah
  instead of /C:/blah.  The latter is a relative URI with an absolute path.
  This is later resolved against the base URI. If the base URI didn't look
  like file:///blah/blah/blah then you'd get unexpected results. For instance
  if the base URI were http://www.abc.com we'd get http://www.abc.com/C:/blah
  instead of file:///C:/blah.
  
  Revision  Changes    Path
  1.93      +5 -5      
xml-xerces/java/src/org/apache/xerces/impl/XMLEntityManager.java
  
  Index: XMLEntityManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XMLEntityManager.java,v
  retrieving revision 1.92
  retrieving revision 1.93
  diff -u -r1.92 -r1.93
  --- XMLEntityManager.java     17 Nov 2004 19:11:10 -0000      1.92
  +++ XMLEntityManager.java     17 Nov 2004 20:02:42 -0000      1.93
  @@ -2065,17 +2065,17 @@
           // Windows fix
           if (str.length() >= 2) {
               char ch1 = str.charAt(1);
  -            // change "C:blah" to "/C:blah"
  +            // change "C:blah" to "file:///C:blah"
               if (ch1 == ':') {
                   char ch0 = Character.toUpperCase(str.charAt(0));
                   if (ch0 >= 'A' && ch0 <= 'Z') {
  -                    sb = new StringBuffer(str.length());
  -                    sb.append('/');
  +                    sb = new StringBuffer(str.length() + 8);
  +                    sb.append("file:///");
                   }
               }
               // change "//blah" to "file://blah"
               else if (ch1 == '/' && str.charAt(0) == '/') {
  -                sb = new StringBuffer(str.length());
  +                sb = new StringBuffer(str.length() + 5);
                   sb.append("file:");
               }
           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to