diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-05-17 02:29:13 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-05-17 02:29:13 +0000 |
commit | 34c96140f3e767e0a3bd9e82db55e46593d4f3b8 (patch) | |
tree | 4c5005a0fbf3fab757028651ed7c006678f95404 /file.c | |
parent | c39e8c6e854032645b0f2b799294d3e96d066697 (diff) | |
download | ruby-34c96140f3e767e0a3bd9e82db55e46593d4f3b8.tar.gz |
* file.c (rb_file_s_extname): first dot is not an extension name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -3104,7 +3104,7 @@ rb_file_s_extname(VALUE klass, VALUE fname) if (!p) p = name; else - p++; + name = ++p; e = 0; while (*p) { @@ -3134,7 +3134,7 @@ rb_file_s_extname(VALUE klass, VALUE fname) break; p = CharNext(p); } - if (!e || e+1 == p) /* no dot, or the only dot is first or end? */ + if (!e || e == name || e+1 == p) /* no dot, or the only dot is first or end? */ return rb_str_new(0, 0); extname = rb_str_new(e, p - e); /* keep the dot, too! */ rb_enc_copy(extname, fname); |