* file.c (file_expand_path): wrong condition. [ruby-core:31591]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b254655922
commit
49e259ec58
@ -1,3 +1,7 @@
|
|||||||
|
Mon Aug 2 12:22:22 2010 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* file.c (file_expand_path): wrong condition. [ruby-core:31591]
|
||||||
|
|
||||||
Mon Aug 2 05:34:48 2010 Tanaka Akira <akr@fsij.org>
|
Mon Aug 2 05:34:48 2010 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* ext/pathname/pathname.c (path_realdirpath): Pathname#realdirpath
|
* ext/pathname/pathname.c (path_realdirpath): Pathname#realdirpath
|
||||||
|
2
file.c
2
file.c
@ -2897,7 +2897,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
|
|||||||
else {
|
else {
|
||||||
/* specified drive, but not full path */
|
/* specified drive, but not full path */
|
||||||
int same = 0;
|
int same = 0;
|
||||||
if (!NIL_P(dname) || !not_same_drive(dname, s[0])) {
|
if (!NIL_P(dname) && !not_same_drive(dname, s[0])) {
|
||||||
file_expand_path(dname, Qnil, abs_mode, result);
|
file_expand_path(dname, Qnil, abs_mode, result);
|
||||||
BUFINIT();
|
BUFINIT();
|
||||||
if (has_drive_letter(p) && TOLOWER(p[0]) == TOLOWER(s[0])) {
|
if (has_drive_letter(p) && TOLOWER(p[0]) == TOLOWER(s[0])) {
|
||||||
|
@ -393,6 +393,7 @@ class TestFileExhaustive < Test::Unit::TestCase
|
|||||||
assert_equal(@file, File.expand_path(@file + " "))
|
assert_equal(@file, File.expand_path(@file + " "))
|
||||||
assert_equal(@file, File.expand_path(@file + "."))
|
assert_equal(@file, File.expand_path(@file + "."))
|
||||||
assert_equal(@file, File.expand_path(@file + "::$DATA"))
|
assert_equal(@file, File.expand_path(@file + "::$DATA"))
|
||||||
|
assert_match(/\Ac:\//i, File.expand_path('c:'), '[ruby-core:31591]')
|
||||||
end
|
end
|
||||||
assert_kind_of(String, File.expand_path("~"))
|
assert_kind_of(String, File.expand_path("~"))
|
||||||
assert_raise(ArgumentError) { File.expand_path("~foo_bar_baz_unknown_user_wahaha") }
|
assert_raise(ArgumentError) { File.expand_path("~foo_bar_baz_unknown_user_wahaha") }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user