From b1e55e5b923685e3fb1110f0dfba85de10d6045b Mon Sep 17 00:00:00 2001 From: wyhaines Date: Tue, 25 Aug 2009 18:37:21 +0000 Subject: Fix for backport #1168 -- wrong result of File.extname for a path that contains a space before the extension. Fix for backport #1975 -- the test suite for backport #1168 uses Dir.mktmpdir, which was backported into 1.8 HEAD and 1.8.7 in the past. This change for 1.8.6 doesn't break anything already existing in 1.8.6, and is a pure-ruby addition, so it was backported. See http://redmine.ruby-lang.org/issues/show/1975 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@24653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'file.c') diff --git a/file.c b/file.c index 543d881298..1aee841e7f 100644 --- a/file.c +++ b/file.c @@ -3038,7 +3038,7 @@ rb_file_s_extname(klass, fname) p = last; break; } - if (*last == '.') e = dot; + if (*last == '.' || dot > last) e = dot; continue; #else e = p; /* get the last dot of the last component */ -- cgit v1.2.3