summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorwyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-25 18:37:21 +0000
committerwyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-25 18:37:21 +0000
commitb1e55e5b923685e3fb1110f0dfba85de10d6045b (patch)
tree5277a571d14d6f23a27377ebe76abb9ea45fd006 /file.c
parenta0343dd9a490e45f3210ca70a038b2a4a4c6961c (diff)
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
Diffstat (limited to 'file.c')
-rw-r--r--file.c2
1 files changed, 1 insertions, 1 deletions
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 */