Project

General

Profile

Actions

Bug #174

closed

[1.8.6] File.extname(".profile") is not returning an empty String

Added by NoKarma (Arthur Schreiber) over 16 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
-
ruby -v:
[ruby-core:17290]

Description

=begin
In the latest patchlevel versions of the ruby_1_8_6 branch, the File.extname method stopped returning empty Strings for files starting with a dot:

Latest version of the ruby_1_8 branch:
File.extname(".profile") # => ""

Latest version of the ruby_1_8_7 branch:
File.extname(".profile") # => ""

Latest version of the ruby_1_8_6 branch:
File.extname(".profile") # => ".profile"
=end

Actions #1

Updated by shyouhei (Shyouhei Urabe) over 16 years ago

=begin
This is a Ruby 1.8.7 feature so who changed its behavior is 1.8.7,
rather than 1.8.6.
=end

Actions #2

Updated by shyouhei (Shyouhei Urabe) over 16 years ago

  • Status changed from Open to Closed

=begin
Not a bug.
=end

Actions #3

Updated by NoKarma (Arthur Schreiber) over 16 years ago

=begin
That is definately a bug, as earlier Ruby 1.8.6 patchlevels showed
exactly the same behaviour as 1.8.7:

VERSION = 1.8.6-p111:

irb(main):001:0> File.extname(".profile")
=> ""

VERSION = 1.8.6-p114

irb(main):001:0> File.extname(".profile")
=> ""

VERSION = 1.8.6-p166

irb(main):001:0> File.extname(".profile")
=> ""

VERSION = 1.8.6-p222

irb(main):001:0> File.extname(".profile")
=> ".profile"

VERSION = 1.8.7-p17

irb(main):001:0> File.extname(".profile")
=> ""

VERSION = 1.8.7-p7

irb(main):001:0> File.extname(".profile")
=> ""

VERSION = 1.8.7

irb(main):001:0> File.extname(".profile")
=> ""

=end

Actions #4

Updated by shyouhei (Shyouhei Urabe) over 16 years ago

=begin
Ah, sorry I was wrong.

I've backported corresponding patch from 1.8 branch. Thank you pointing this out.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0