1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[DOC] no change on Windows [Bug #15267] [ci skip]

This commit is contained in:
Nobuyoshi Nakada 2019-10-17 19:42:25 +09:00
parent e169ad93f4
commit 4f13927f1f
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60
2 changed files with 6 additions and 3 deletions

4
NEWS
View file

@ -194,8 +194,8 @@ Fiber::
File::
Modified method::
* File.extname now returns a dot string at a name ending with a
dot. [Bug #15267]
* File.extname now returns a dot string at a name ending with a dot on
non-Windows platforms. [Bug #15267]
File.extname("foo.") #=> "."

5
file.c
View file

@ -4789,10 +4789,13 @@ ruby_enc_find_extname(const char *name, long *len, rb_encoding *enc)
* An empty string will also be returned when the period is the last character
* in +path+.
*
* On Windows, trailing dots are truncated.
*
* File.extname("test.rb") #=> ".rb"
* File.extname("a/b/d/test.rb") #=> ".rb"
* File.extname(".a/b/d/test.rb") #=> ".rb"
* File.extname("foo.") #=> "."
* File.extname("foo.") #=> "" on Windows
* File.extname("foo.") #=> "." on non-Windows
* File.extname("test") #=> ""
* File.extname(".profile") #=> ""
* File.extname(".profile.sh") #=> ".sh"