[FIXED JENKINS-19821] recognize UNC path as absolute

This commit is contained in:
Nicolas De Loof committed 2013-10-01 12:19:48 +02:00
1 parent 67be8def39
commit 6450647d64
1 file changed
+2 -1
+2 -1
View File
@@ -241,10 +241,11 @@ public final class FilePath implements Serializable {
* Is the given path name an absolute path?
*/
private static boolean isAbsolute(String rel) {
return rel.startsWith("/") || DRIVE_PATTERN.matcher(rel).matches();
return rel.startsWith("/") || DRIVE_PATTERN.matcher(rel).matches() || UNC_PATTERN.matcher(rel).matches();
}
private static final Pattern DRIVE_PATTERN = Pattern.compile("[A-Za-z]:[\\\\/].*"),
UNC_PATTERN = Pattern.compile("^\\\\\\\\.*"),
ABSOLUTE_PREFIX_PATTERN = Pattern.compile("^(\\\\\\\\|(?:[A-Za-z]:)?[\\\\/])[\\\\/]*");
/**