Project

General

Profile

Bug #15244

Method #extname return empty string if filename is dot ('.')

Added by TiSer (Sergey Ti) about 2 years ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:89529]
Tags:

Description

Example 1:

Current behaviour:

File.extname('..jpg')
=> ""

Expected behaviour:

File.extname('..jpg')
=> ".jpg"

Example 2:

Current behaviour:

File.extname('....jpg')
=> ""

Expected behaviour:

=> ".jpg"

Files

dot-names.diff (891 Bytes) dot-names.diff rushsteve1 (Steven vanZyl), 08/02/2019 03:15 PM
multiple-leading-dot-basename-extname-15244.patch (1.94 KB) multiple-leading-dot-basename-extname-15244.patch jeremyevans0 (Jeremy Evans), 08/14/2019 01:08 AM

Related issues

Related to Ruby master - Bug #15267: File.basename + File.extname does not restore the original nameClosedActions

Also available in: Atom PDF