[ruby-core:89531] [Ruby trunk Bug#15244] Method #extname return empty string if filename is dot ('.')

From: ug.tiser@...
Date: 2018-10-23 11:56:26 UTC
List: ruby-core #89531
Issue #15244 has been updated by TiSer (Sergey TiSer).

Description updated

add one more example

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

* 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:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next