summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--file.c2
-rw-r--r--test/ruby/test_file_exhaustive.rb2
3 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index c92bfb8d54e..d65df98a975 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Apr 20 00:43:03 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * file.c (rb_file_s_extname): skip last directory separators.
+ [ruby-core:29627]
+
Tue Apr 20 00:41:25 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (internal_{read,write}_func, rb_{read,write}_internal):
diff --git a/file.c b/file.c
index af2730a12fd..f9f81926372 100644
--- a/file.c
+++ b/file.c
@@ -3500,7 +3500,7 @@ rb_file_s_extname(VALUE klass, VALUE fname)
if (!p)
p = name;
else
- name = ++p;
+ do name = ++p; while (isdirsep(*p));
e = 0;
while (*p && *p == '.') p++;
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index 4a26e435b8b..634197e0a76 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -454,6 +454,8 @@ class TestFileExhaustive < Test::Unit::TestCase
end
end
end
+ bug3175 = '[ruby-core:29627]'
+ assert_equal(".rb", File.extname("/tmp//bla.rb"), bug3175)
assert_incompatible_encoding {|d| File.extname(d)}
end