Bug #4393

windows commands starting with "@" should run at all

Added by Roger Pack over 4 years ago. Updated over 4 years ago.

[ruby-core:35218]
Status:Closed
Priority:Normal
Assignee:-
ruby -v:ruby 1.9.3dev (2011-02-09 trunk 30831) [i386-mswin32_100] Backport:

Description

=begin
Hello all.
Originally reported this here:
http://www.ruby-forum.com/topic/1060963

I believe in windows the following should work but fails (should call out to cmd to process it...)

system("ls.exe")
2.3 2.4

=> true

system("@ls.exe")
=> nil

Thanks!
-r
=end


Related issues

Related to Ruby trunk - Bug #4396: windows commands starting with "@" should run at all even though command string is quoted by `"'. Rejected 02/14/2011

Associated revisions

Revision 30867
Added by Usaku NAKAMURA over 4 years ago

  • win32/win32.c (is_internal_cmd): if the first char of prog is '@', execute it via shell. ruby-core:35218

Revision 30867
Added by Usaku NAKAMURA over 4 years ago

  • win32/win32.c (is_internal_cmd): if the first char of prog is '@', execute it via shell. ruby-core:35218

Revision 30868
Added by Motohiro KOSAKI over 4 years ago

  • test/ruby/test_system.rb (TestSystem#test_system_at): added test. ruby-core:35218

Revision 30868
Added by Motohiro KOSAKI over 4 years ago

  • test/ruby/test_system.rb (TestSystem#test_system_at): added test. ruby-core:35218

Revision 30869
Added by Motohiro KOSAKI over 4 years ago

  • test/ruby/test_system.rb (TestSystem#test_system_at): added test. ruby-core:35218

Revision 30869
Added by Motohiro KOSAKI over 4 years ago

  • test/ruby/test_system.rb (TestSystem#test_system_at): added test. ruby-core:35218

History

#1 Updated by Motohiro KOSAKI over 4 years ago

  • ruby -v changed from ruby 1.9.2p0 (2010-08-18) [i386-mingw32] to ruby 1.9.3dev (2011-02-09 trunk 30831) [i386-mswin32_100]

=begin
Agreed. C lang's System() allow system("@dir"). Therefore ruby's should allow it too.
Plus, This can be reporoduced on trunk. then I've replaced `ruby -v' field.

=end

#2 Updated by Usaku NAKAMURA over 4 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r30867.
Roger, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • win32/win32.c (is_internal_cmd): if the first char of prog is '@', execute it via shell. ruby-core:35218 =end

#3 Updated by Motohiro KOSAKI over 4 years ago

Note: ruby 1.8 makes different result. because we changed system() spec at ruby-1.9.

system("@ls.exe")
=> false

Also available in: Atom PDF