Changeset 11307
- Timestamp:
- 09/10/08 20:00:57 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/Pathname.java
r11297 r11307 94 94 return; 95 95 } 96 if (Utilities.isPlatformWindows) 96 if (Utilities.isPlatformWindows) { 97 if (s.startsWith("\\\\")) { 98 //UNC path support 99 // match \\<server>\<share>\[directories-and-files] 100 101 int shareIndex = s.indexOf('\\', 2); 102 int dirIndex = s.indexOf('\\', shareIndex + 1); 103 104 if (shareIndex == -1 || dirIndex == -1) 105 error(new LispError("Unsupported UNC path format: \"" + s + '"')); 106 107 host = new SimpleString(s.substring(2, shareIndex)); 108 device = new SimpleString(s.substring(shareIndex + 1, dirIndex)); 109 110 Pathname p = new Pathname(s.substring(dirIndex)); 111 directory = p.directory; 112 name = p.name; 113 type = p.type; 114 version = p.version; 115 return; 116 } 117 97 118 s = s.replace('/', '\\'); 119 } 98 120 // Jar file support. 99 121 int bang = s.indexOf("!/"); … … 263 285 if (host != NIL) { 264 286 Debug.assertTrue(host instanceof AbstractString); 287 if (! (this instanceof LogicalPathname)) 288 sb.append("\\\\"); //UNC file support; if there's a host, it's a UNC path. 265 289 sb.append(host.getStringValue()); 266 sb.append(':'); 290 if (this instanceof LogicalPathname) 291 sb.append(':'); 292 else 293 sb.append(File.separatorChar); 267 294 } 268 295 if (device == NIL) … … 272 299 else if (device instanceof AbstractString) { 273 300 sb.append(device.getStringValue()); 274 sb.append(':'); 301 if (this instanceof LogicalPathname 302 || host == NIL) 303 sb.append(':'); // non-UNC paths 275 304 } else if (device instanceof Pathname) { 276 305 sb.append(((Pathname)device).getNamestring());
Note: See TracChangeset
for help on using the changeset viewer.