[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-core
Subject:    [ruby-core:89613] [Ruby trunk Bug#15244] Method #extname return empty string if filename is dot ('.'
From:       nobu () ruby-lang ! org
Date:       2018-10-29 5:42:00
Message-ID: redmine.journal-74652.20181029054159.34d75b397ae8c5a8 () ruby-lang ! org
[Download RAW message or body]

Issue #15244 has been updated by nobu (Nobuyoshi Nakada).


If `File.extname("..jpg")` returns `".jpg"`, `File.basename("..jpg", ".*")` should \
return `"."` without that part, to restore the original name from from these results. \
It is different from basename(1).

```
$ basename ..jpg '.*'
..jpg
```


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

* 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')
=> ".jpg"
```


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

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



-- 
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>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic