[#97536] [Ruby master Bug#16694] JIT vs hardened GCC with PCH — v.ondruch@...
Issue #16694 has been reported by vo.x (Vit Ondruch).
11 messages
2020/03/18
[ruby-core:97614] [Ruby master Feature#16741] Implement Shellwords.shellescape correctly on Windows
From:
mame@...
Date:
2020-03-29 05:17:55 UTC
List:
ruby-core #97614
Issue #16741 has been updated by mame (Yusuke Endoh).
I agree with @znz. IMO, a gem named `cmdwords` or something would be a good start for the feature instead of directly extending `shellwords`.
----------------------------------------
Feature #16741: Implement Shellwords.shellescape correctly on Windows
https://bugs.ruby-lang.org/issues/16741#change-84804
* Author: abobrikovich (Alexander Bobrikovich)
* Status: Open
* Priority: Normal
----------------------------------------
**Reproduce process**
```irb
irb(main):002:0> require 'shellwords'
=> true
irb(main):005:0> Shellwords.shellescape("/home/me/test with space.txt")
=> "/home/me/test\\ with\\ space.txt"
```
**Expected result and the reason why you expect**
I understand that `shellwords` module originally was designed & developed for *NIX but I think it's a good chance to extend it to support Windows too
For batch looks like quotation is a single option according to [2] if we need it, for example for paths that have space inside of it.
Proposed implementation:
```irb
irb(main):004:0> Shellwords.shellescape("C:\Program Files")
=> "\"C:\Program Files\""
```
Current implementation:
```irb
irb(main):004:0> Shellwords.shellescape("C:\Program Files")
=> "C:Program\\ Files"
```
Links
1. https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
2. https://superuser.com/a/962816/245944
3. https://ss64.com/nt/syntax-esc.html
--
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>