* 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
This commit is contained in:
usa 2015-10-18 16:29:07 +00:00
Родитель 0bb6bf24b5
Коммит a01dfd479f
2 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Mon Oct 19 01:26:26 2015 NAKAMURA Usaku <usa@ruby-lang.org>
* file.c (rb_file_identical_p): not necessary to compare the paths after
comparing the file indexes on Windows. designate by kosaki.
Sun Oct 18 21:17:27 2015 Tanaka Akira <akr@fsij.org>
* lib/open-uri.rb: Specify frozen_string_literal: true.

9
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;
}
/*