diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | test/ruby/test_file_exhaustive.rb | 4 | ||||
-rw-r--r-- | win32/file.c | 4 |
3 files changed, 13 insertions, 3 deletions
@@ -1,3 +1,11 @@ +Sat Nov 17 21:45:12 Luis Lavena <luislavena@gmail.com> + + * win32/file.c (replace_to_long_name): skip expansion for all wildcard + characters. + [ruby-core:49451] [Bug #7374] + + * test/ruby/test_file_exhaustive.rb: add more assertions to test. + Sat Nov 17 12:14:50 2012 Aaron Patterson <aaron@tenderlovemaking.com> * ext/psych/lib/psych/visitors/yaml_tree.rb: use literal YAML style diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb index 3fd8b3374e..360a1c7cce 100644 --- a/test/ruby/test_file_exhaustive.rb +++ b/test/ruby/test_file_exhaustive.rb @@ -662,9 +662,11 @@ class TestFileExhaustive < Test::Unit::TestCase assert_equal("#{DRIVE}/dir", File.expand_path("#{DRIVE}/./dir")) end - def test_expand_path_does_not_expand_wildcard + def test_expand_path_does_not_expand_wildcards assert_equal("#{DRIVE}/*", File.expand_path("./*", "#{DRIVE}/")) assert_equal("#{Dir.pwd}/*", File.expand_path("./*", Dir.pwd)) + assert_equal("#{DRIVE}/?", File.expand_path("./?", "#{DRIVE}/")) + assert_equal("#{Dir.pwd}/?", File.expand_path("./?", Dir.pwd)) end if DRIVE def test_expand_path_does_not_modify_the_string_argument diff --git a/win32/file.c b/win32/file.c index 1f033c646b..5550a5751d 100644 --- a/win32/file.c +++ b/win32/file.c @@ -276,8 +276,8 @@ replace_to_long_name(wchar_t **wfullpath, size_t size, int heap) return size; } - /* skip long name conversion if last character is a wildcard */ - if (pos[size - 1] == L'*') { + /* skip long name conversion if path contains wildcard characters */ + if (!wcspbrk(pos, "*?")) { return size; } |