Issue #15244 has been updated by shevegen (Robert A. Heiler).


Is this a real problem?

How many people have had entries with more leading '.'?

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

It's not that I am not inclined to agree about it; I just think 
it's a bit strange to want to change that behaviour. Do people 
use lots of '.' for names to files or directories or symlinks?

----------------------------------------
Bug #15244: Method #extname return empty string if filename is dot ('.')
https://bugs.ruby-lang.org/issues/15244#change-74583

* Author: TiSer (Sergey TiSer)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.5.0p0
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
### Example 1:
Current behaviour:
```
File.extname('..jpg')
=> ""
```

Expected behaviour: 
```
File.extname('..jpg')
=> "."
```


### Example 2:
Current behaviour:
```
File.extname('....jpg')
=> ""
```

Expected behaviour: 
```
=> "..."
```



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>