Skip to content

Commit

Permalink
UNC paths processed only on Windows
Browse files Browse the repository at this point in the history
enebo committed Apr 8, 2016
1 parent 7047e19 commit a8eef1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyFile.java
Original file line number Diff line number Diff line change
@@ -723,7 +723,7 @@ public static String dirname(ThreadContext context, String path) {
if (lastSlash == 0) return path.substring(0, 1); // '/' or '\'
if (lastSlash == 2 && hasDriveLetter) return path.substring(0, 3); // 'C:[/\\]file'

if (normalizedPath.startsWith("//")) { // UNC path
if (Platform.IS_WINDOWS && normalizedPath.startsWith("//")) { // UNC path
if (lastSlash == 1) return path.substring(0, normalizedPath.length()); // '//foo'

if (!normalizedPath.substring(2, lastSlash - 2).contains("/")) { // '//foo/bar'

0 comments on commit a8eef1f

Please sign in to comment.