aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-18 16:29:07 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-18 16:29:07 +0000
commitf89155212f2e379a38080db6c27ee977be6cb5aa (patch)
tree1c2b02eb160addbde160d5bc9573c8f6a13545db /file.c
parent4dd07beaf3b290368e46bbff4e0f9584dd04124c (diff)
downloadruby-f89155212f2e379a38080db6c27ee977be6cb5aa.tar.gz
* file.c (rb_file_identical_p): not necessary to compare the paths after
comparing the file indexes on Windows. designate by kosaki. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/file.c b/file.c
index 5591309f31..04e3b4b8f3 100644
--- a/file.c
+++ b/file.c
@@ -1939,6 +1939,7 @@ rb_file_identical_p(VALUE obj, VALUE fname1, VALUE fname2)
if (rb_stat(fname2, &st2) < 0) return Qfalse;
if (st1.st_dev != st2.st_dev) return Qfalse;
if (st1.st_ino != st2.st_ino) return Qfalse;
+ return Qtrue;
#else
BY_HANDLE_FILE_INFORMATION st1, st2;
HANDLE f1 = 0, f2 = 0;
@@ -1961,14 +1962,8 @@ rb_file_identical_p(VALUE obj, VALUE fname1, VALUE fname2)
st1.nFileIndexHigh == st2.nFileIndexHigh &&
st1.nFileIndexLow == st2.nFileIndexLow)
return Qtrue;
- if (!f1 || !f2) return Qfalse;
- fname1 = rb_file_expand_path(fname1, Qnil);
- fname2 = rb_file_expand_path(fname2, Qnil);
- if (RSTRING_LEN(fname1) != RSTRING_LEN(fname2)) return Qfalse;
- if (rb_memcicmp(RSTRING_PTR(fname1), RSTRING_PTR(fname2), RSTRING_LEN(fname1)))
- return Qfalse;
+ return Qfalse;
#endif
- return Qtrue;
}
/*