ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:53162] [ruby-trunk - Bug #8028][Open] Shellwords.escape works incorrect under windows
@ 2013-03-06  8:31 Shagabutdinov (Leonid Shagabutdinov)
  2019-01-02 17:00 ` [ruby-core:90858] [Ruby trunk Bug#8028] " justin
  2019-01-03 14:03 ` [ruby-core:90871] [Ruby trunk Bug#8028][Rejected] " nobu
  0 siblings, 2 replies; 3+ messages in thread
From: Shagabutdinov (Leonid Shagabutdinov) @ 2013-03-06  8:31 UTC (permalink / raw)
  To: ruby-core


Issue #8028 has been reported by Shagabutdinov (Leonid Shagabutdinov).

----------------------------------------
Bug #8028: Shellwords.escape works incorrect under windows
https://bugs.ruby-lang.org/issues/8028

Author: Shagabutdinov (Leonid Shagabutdinov)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 2.0.0p0 (2013-02-24) [i386-mingw32]


Shellwords.escape works incorrect under windows (tested for Windows 7
x64), here is example:


Actual result:

irb(main):001:0> require 'shellwords'
=> true

irb(main):002:0> `echo #{Shellwords.escape( '123>' )} test` # should
echo "123> test", but echo nothing
=> ""

irb(main):003:0> File.read( 'test' ) # but writes file "test"
=> "123\\\n"


Expected result:

irb(main):001:0> `echo 132^> test` # the correct escape sequence, echoed
"123> test"
=> "132> test\n"


Tested for "ruby 2.0.0p0 (2013-02-24) [i386-mingw32]", ruby 1.9.3, but this bug can be found in earlier ruby versions as well.




-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:90858] [Ruby trunk Bug#8028] Shellwords.escape works incorrect under windows
  2013-03-06  8:31 [ruby-core:53162] [ruby-trunk - Bug #8028][Open] Shellwords.escape works incorrect under windows Shagabutdinov (Leonid Shagabutdinov)
@ 2019-01-02 17:00 ` justin
  2019-01-03 14:03 ` [ruby-core:90871] [Ruby trunk Bug#8028][Rejected] " nobu
  1 sibling, 0 replies; 3+ messages in thread
From: justin @ 2019-01-02 17:00 UTC (permalink / raw)
  To: ruby-core

Issue #8028 has been updated by jsc (Justin Collins).


Shagabutdinov (Leonid Shagabutdinov) wrote:
> Shellwords.escape works incorrect under windows (tested for Windows 7

I don't believe `Shellwords` is intended to work on Windows at all. According to the comments (https://github.com/ruby/ruby/blob/ee2ddf5411f51ea89a1569ea5d70b41cd4c6c7f2/lib/shellwords.rb#L3-L6):

~~~
# == Manipulates strings like the UNIX Bourne shell
#
# This module manipulates strings according to the word parsing rules
# of the UNIX Bourne shell.
~~~



----------------------------------------
Bug #8028: Shellwords.escape works incorrect under windows
https://bugs.ruby-lang.org/issues/8028#change-76044

* Author: Shagabutdinov (Leonid Shagabutdinov)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.0.0p0 (2013-02-24) [i386-mingw32]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
Shellwords.escape works incorrect under windows (tested for Windows 7
x64), here is example:


Actual result:

irb(main):001:0> require 'shellwords'
=> true

irb(main):002:0> `echo #{Shellwords.escape( '123>' )} test` # should
echo "123> test", but echo nothing
=> ""

irb(main):003:0> File.read( 'test' ) # but writes file "test"
=> "123\\\n"


Expected result:

irb(main):001:0> `echo 132^> test` # the correct escape sequence, echoed
"123> test"
=> "132> test\n"


Tested for "ruby 2.0.0p0 (2013-02-24) [i386-mingw32]", ruby 1.9.3, but this bug can be found in earlier ruby versions as well.





-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:90871] [Ruby trunk Bug#8028][Rejected] Shellwords.escape works incorrect under windows
  2013-03-06  8:31 [ruby-core:53162] [ruby-trunk - Bug #8028][Open] Shellwords.escape works incorrect under windows Shagabutdinov (Leonid Shagabutdinov)
  2019-01-02 17:00 ` [ruby-core:90858] [Ruby trunk Bug#8028] " justin
@ 2019-01-03 14:03 ` nobu
  1 sibling, 0 replies; 3+ messages in thread
From: nobu @ 2019-01-03 14:03 UTC (permalink / raw)
  To: ruby-core

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

Description updated
Status changed from Open to Rejected

Escaping ways are various across shells, not only Windows.
Use `system` with an array, e.g., `system('echo', '123>')`.

----------------------------------------
Bug #8028: Shellwords.escape works incorrect under windows
https://bugs.ruby-lang.org/issues/8028#change-76059

* Author: Shagabutdinov (Leonid Shagabutdinov)
* Status: Rejected
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.0.0p0 (2013-02-24) [i386-mingw32]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
Shellwords.escape works incorrect under windows (tested for Windows 7
x64), here is example:


Actual result:
```
irb(main):001:0> require 'shellwords'
=> true

irb(main):002:0> `echo #{Shellwords.escape( '123>' )} test` # should
echo "123> test", but echo nothing
=> ""

irb(main):003:0> File.read( 'test' ) # but writes file "test"
=> "123\\\n"
```

Expected result:
```
irb(main):001:0> `echo 132^> test` # the correct escape sequence, echoed
"123> test"
=> "132> test\n"
```

Tested for "ruby 2.0.0p0 (2013-02-24) [i386-mingw32]", ruby 1.9.3, but this bug can be found in earlier ruby versions as well.





-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-03 14:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-06  8:31 [ruby-core:53162] [ruby-trunk - Bug #8028][Open] Shellwords.escape works incorrect under windows Shagabutdinov (Leonid Shagabutdinov)
2019-01-02 17:00 ` [ruby-core:90858] [Ruby trunk Bug#8028] " justin
2019-01-03 14:03 ` [ruby-core:90871] [Ruby trunk Bug#8028][Rejected] " nobu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).