mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-06 16:45:58 +00:00
[FIXED JENKINS-19821] recognize UNC path as absolute
This commit is contained in:
1 parent
67be8def39
commit
6450647d64
1 file changed
+2
-1
@@ -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]:)?[\\\\/])[\\\\/]*");
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user