mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* file.c (rb_file_s_extname): skip last directory separators.
[ruby-core:29627] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a91d8b8c33
commit
cb508fe739
3 changed files with 8 additions and 1 deletions
|
@ -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):
|
||||
|
|
2
file.c
2
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++;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue