Forum: Ruby-core REGRESSION: File.extname() broken (at least >= 1.8.7)

Posted by fahmisetiawan (Fahmi Setiawan) (Guest)
on 2012-10-01 13:36
(Received via mailing list)
Issue #3882 has been updated by fahmisetiawan (Fahmi Setiawan).


http://alkian.blogspot.com/2012/09/cara-menyembuhk...
http://alkian.blogspot.com/2012/09/keretamini-kere...
http://alkian.blogspot.com/2012/09/harga-spesifika...
http://alkian.blogspot.com/2012/09/download-one-pi...
http://alkian.blogspot.com/2012/09/harga-dan-spesi...
http://alkian.blogspot.com/2012/09/harga-dan-spesi...
http://alkian.blogspot.com/2012/09/download-harves...
http://alkian.blogspot.com/2012/09/download-gratis...
http://alkian.blogspot.com/2012/09/cara-download-d...
http://alkian.blogspot.com/2012/09/cara-mengganti-...
http://alkian.blogspot.com/2012/09/free-download-w...
http://alkian.blogspot.com/2012/09/free-download-k...
http://alkian.blogspot.com/2012/09/free-download-c...
http://alkian.blogspot.com/2012/09/cara-membuat-re...
http://alkian.blogspot.com/2012/09/daftar-harga-le...
http://alkian.blogspot.com/2012/09/download-theme-...
http://alkian.blogspot.com/2012/09/download-alqura...
http://alkian.blogspot.com/2012/09/kumpulan-kata-k...
http://alkian.blogspot.com/2012/09/kumpulan-websit...
http://alkian.blogspot.com/2012/09/template-seo-fr...
http://alkian.blogspot.com/2012/09/harga-hp-nokia-...
http://alkian.blogspot.com/2012/09/foto-ariel-noah...
http://alkian.blogspot.com/2012/09/download-serial...
http://alkian.blogspot.com/2012/09/biodata-foto-iq...
http://alkian.blogspot.com/2012/09/harga-dan-spesi...
http://alkian.blogspot.com/2012/09/biodata-akb48-l...
http://alkian.blogspot.com/2012/08/arti-dan-makna-...
----------------------------------------
Backport #3882: REGRESSION: File.extname() broken (at least >= 1.8.7)
https://bugs.ruby-lang.org/issues/3882#change-29906

Author: AndiM (Andreas Mohr)
Status: Assigned
Priority: Normal
Assignee: wyhaines (Kirk Haines)
Category: core
Target version:


=begin
 Hi,

 #!/usr/bin/ruby

 require 'pathname'

 mytest_filename = ARGV.shift

 #mytest_filename_cleaned = Pathname.new(mytest_filename).cleanpath
 mytest_filename_cleaned = mytest_filename

 puts "mytest_filename #{mytest_filename} mytest_filename_cleaned 
#{mytest_filename_cleaned}"

 myext = File.extname(mytest_filename_cleaned)
 puts "mytest_filename_cleaned #{mytest_filename_cleaned} myext 
#{myext}"



 Try .//test.out
 Won't do what it should, at least on u10.04 ruby1.8 1.8.7.249-2 and 
ruby1.9.1 1.9.1.378-1,
 as opposed to correct behaviour on ruby-1.8.5-5.el5_4.8.

 Since http://ruby-doc.org/core/classes/File.html#M002543 doesn't really 
specify extname() argument composition constraints
 (other than it being a path), it _should_ accept duplicate slashes 
since this syntax is treated as a valid path pretty much everywhere.

 Do you happen to have a test suite for these core API things? Since 
extname() also had some other issues (spaces before extension etc.),
 this would be useful.

 Other than this rather disturbing behaviour, I'm VERY impressed with 
Ruby.

 Thanks,

 Andreas Mohr
=end
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.