Skip to content

Commit

Permalink
[FIXED JENKINS-19821] recognize UNC path as absolute
Browse files Browse the repository at this point in the history
  • Loading branch information
ndeloof committed Oct 1, 2013
1 parent 67be8de commit 16d9c59
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/main/java/hudson/FilePath.java
Expand Up @@ -241,10 +241,11 @@ private String resolvePathIfRelative(FilePath base, String rel) {
* 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]:)?[\\\\/])[\\\\/]*");

/**
Expand Down

0 comments on commit 16d9c59

Please sign in to comment.