summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-11 10:19:51 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-11 10:19:51 +0000
commit51f64b032a93d9521962e0ea11fa77536c8df602 (patch)
treec76840149834c910357895d737fee181c4388413
parent4701a70b31fdb07f560822d79b1d1f0742a82afb (diff)
merge revision(s) 37692,37700,37706: [Backport #7381]
* win32/file.c (replace_to_long_name): skip automatic path expansion when wildcard character is used. [ruby-core:49451] [Bug #7374] * test/ruby/test_file_exhaustive.rb: add a test for above. * 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. * win32/file.c (replace_to_long_name): correct logic around wildcard characters detection and ensure wide-chars are used as pattern. [ruby-core:49451] [Bug #7374] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@38321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog21
-rw-r--r--test/ruby/test_file_exhaustive.rb7
-rw-r--r--version.h2
-rw-r--r--win32/file.c5
4 files changed, 34 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 8ba4281edb..b40a8087fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+Tue Dec 11 19:19:33 2012 Luis Lavena <luislavena@gmail.com>
+
+ * win32/file.c (replace_to_long_name): correct logic around wildcard
+ characters detection and ensure wide-chars are used as pattern.
+ [ruby-core:49451] [Bug #7374]
+
+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.
+
+Tue Dec 11 19:19:33 2012 Luis Lavena <luislavena@gmail.com>
+
+ * win32/file.c (replace_to_long_name): skip automatic path expansion
+ when wildcard character is used. [ruby-core:49451] [Bug #7374]
+
+ * test/ruby/test_file_exhaustive.rb: add a test for above.
+
Tue Dec 11 19:18:12 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/mkexports.rb (each_export): skip garbages generated by VS2012's
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index f3c36aa38b..d80c430bce 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -601,6 +601,13 @@ class TestFileExhaustive < Test::Unit::TestCase
assert_equal("#{DRIVE}/dir", File.expand_path("#{DRIVE}/./dir"))
end
+ 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
str = "./a/b/../c"
assert_equal("#{Dir.pwd}/a/c", File.expand_path(str, Dir.pwd))
diff --git a/version.h b/version.h
index 38513ad47f..bbbfc5f034 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 339
+#define RUBY_PATCHLEVEL 340
#define RUBY_RELEASE_DATE "2012-12-11"
#define RUBY_RELEASE_YEAR 2012
diff --git a/win32/file.c b/win32/file.c
index e3b50b450f..dfe122480f 100644
--- a/win32/file.c
+++ b/win32/file.c
@@ -276,6 +276,11 @@ replace_to_long_name(wchar_t **wfullpath, size_t size, int heap)
return size;
}
+ /* skip long name conversion if path contains wildcard characters */
+ if (wcspbrk(pos, L"*?")) {
+ return size;
+ }
+
pos = *wfullpath + size - 1;
while (!IS_DIR_SEPARATOR_P(*pos) && pos != *wfullpath) {
if (!extension_len && *pos == L'.') {