Improved Windows/Unix detection (#631).

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3706 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2007-07-14 19:47:15 +00:00
1 parent b3a4dae21a
commit 07bcb1a2f5
2 files changed
+4 -1

No files matched your search

+2
View File
@@ -158,6 +158,8 @@ public final class FilePath implements Serializable {
* Checks if the remote path is Unix.
*/
private boolean isUnix() {
// Windows absolute path always include ':', but this is not a valid char in Unix file systems.
if(remote.contains(":")) return false;
// Windows can handle '/' as a path separator but Unix can't,
// so err on Unix side
return remote.indexOf("\\")==-1;