Skip to content

Commit

Permalink
path.equals break identical? for links
Browse files Browse the repository at this point in the history
  • Loading branch information
enebo committed Aug 11, 2011
1 parent ea2466e commit 549f881
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/org/jruby/RubyFileTest.java
Expand Up @@ -186,17 +186,9 @@ public static IRubyObject identical_p(IRubyObject recv, IRubyObject filename1, I
Ruby runtime = recv.getRuntime();
JRubyFile file1 = file(filename1);
JRubyFile file2 = file(filename2);
String path1, path2;
try {
path1 = file1.getCanonicalPath();
path2 = file2.getCanonicalPath();
} catch (IOException e) {
path1 = file1.getAbsolutePath();
path2 = file2.getAbsolutePath();
}

return runtime.newBoolean(file1.exists() && file2.exists() && path1.equals(path2) &&
runtime.getPosix().stat(path1).isIdentical(runtime.getPosix().stat(path2)));
return runtime.newBoolean(file1.exists() && file2.exists() &&
runtime.getPosix().stat(file1.getAbsolutePath()).isIdentical(runtime.getPosix().stat(file2.getAbsolutePath())));
}

@JRubyMethod(name = "owned?", required = 1, module = true)
Expand Down

0 comments on commit 549f881

Please sign in to comment.