equal
deleted
inserted
replaced
241 // Drive relative path ("C:foo" for example). |
241 // Drive relative path ("C:foo" for example). |
242 if (isSameDrive(root, getFileSystem().defaultRoot())) { |
242 if (isSameDrive(root, getFileSystem().defaultRoot())) { |
243 // relative to default directory |
243 // relative to default directory |
244 String remaining = path.substring(root.length()); |
244 String remaining = path.substring(root.length()); |
245 String defaultDirectory = getFileSystem().defaultDirectory(); |
245 String defaultDirectory = getFileSystem().defaultDirectory(); |
246 String result; |
246 if (remaining.length() == 0) { |
247 if (defaultDirectory.endsWith("\\")) { |
247 return defaultDirectory; |
248 result = defaultDirectory + remaining; |
248 } else if (defaultDirectory.endsWith("\\")) { |
|
249 return defaultDirectory + remaining; |
249 } else { |
250 } else { |
250 result = defaultDirectory + "\\" + remaining; |
251 return defaultDirectory + "\\" + remaining; |
251 } |
252 } |
252 return result; |
|
253 } else { |
253 } else { |
254 // relative to some other drive |
254 // relative to some other drive |
255 String wd; |
255 String wd; |
256 try { |
256 try { |
257 int dt = GetDriveType(root + "\\"); |
257 int dt = GetDriveType(root + "\\"); |
410 for (int j=i; j<bn; j++) { |
410 for (int j=i; j<bn; j++) { |
411 result.append("..\\"); |
411 result.append("..\\"); |
412 } |
412 } |
413 |
413 |
414 // append remaining names in child |
414 // append remaining names in child |
415 for (int j=i; j<cn; j++) { |
415 if (!other.isEmpty()) { |
416 result.append(other.getName(j).toString()); |
416 for (int j=i; j<cn; j++) { |
417 result.append("\\"); |
417 result.append(other.getName(j).toString()); |
|
418 result.append("\\"); |
|
419 } |
418 } |
420 } |
419 |
421 |
420 // drop trailing slash in result |
422 // drop trailing slash in result |
421 result.setLength(result.length()-1); |
423 result.setLength(result.length()-1); |
422 return createFromNormalizedPath(getFileSystem(), result.toString()); |
424 return createFromNormalizedPath(getFileSystem(), result.toString()); |