ruby-changes:16838
From: usa <ko1@a...>
Date: Mon, 2 Aug 2010 12:25:30 +0900 (JST)
Subject: [ruby-changes:16838] Ruby:r28833 (trunk): * file.c (file_expand_path): wrong condition.
usa 2010-08-02 12:25:12 +0900 (Mon, 02 Aug 2010) New Revision: 28833 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=28833 Log: * file.c (file_expand_path): wrong condition. [ruby-core:31591] Modified files: trunk/ChangeLog trunk/file.c trunk/test/ruby/test_file_exhaustive.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 28832) +++ ChangeLog (revision 28833) @@ -1,3 +1,7 @@ +Mon Aug 2 12:22:22 2010 NAKAMURA Usaku <usa@r...> + + * file.c (file_expand_path): wrong condition. [ruby-core:31591] + Mon Aug 2 05:34:48 2010 Tanaka Akira <akr@f...> * ext/pathname/pathname.c (path_realdirpath): Pathname#realdirpath Index: test/ruby/test_file_exhaustive.rb =================================================================== --- test/ruby/test_file_exhaustive.rb (revision 28832) +++ test/ruby/test_file_exhaustive.rb (revision 28833) @@ -393,6 +393,7 @@ assert_equal(@file, File.expand_path(@file + " ")) assert_equal(@file, File.expand_path(@file + ".")) assert_equal(@file, File.expand_path(@file + "::$DATA")) + assert_match(/\Ac:\//i, File.expand_path('c:'), '[ruby-core:31591]') end assert_kind_of(String, File.expand_path("~")) assert_raise(ArgumentError) { File.expand_path("~foo_bar_baz_unknown_user_wahaha") } Index: file.c =================================================================== --- file.c (revision 28832) +++ file.c (revision 28833) @@ -2897,7 +2897,7 @@ else { /* specified drive, but not full path */ 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); BUFINIT(); if (has_drive_letter(p) && TOLOWER(p[0]) == TOLOWER(s[0])) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/