[ruby-core:126106] [Ruby Bug#22201] ruby.exe reads `"AA\ " BB` as a single argument
Issue #22201 has been reported by mame (Yusuke Endoh). ---------------------------------------- Bug #22201: ruby.exe reads `"AA\ " BB` as a single argument https://bugs.ruby-lang.org/issues/22201 * Author: mame (Yusuke Endoh) * Status: Open * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- A backslash escapes a double quote that sits beyond a whitespace character. ``` C:\> ruby -e "p ARGV" "AA\ " BB ["AA\\ BB"] # <- actual ["AA\\ ", "BB"] # <- expected ``` This is not intentional, right? The escape is cancelled when almost any other character appears, but I think whitespace seems to have been simply forgotten. The fix is so simple: ``` --- a/win32/win32.c +++ b/win32/win32.c @@ -1739,6 +1739,15 @@ w32_cmdvector(const WCHAR *cmd, char ***vec, UINT cp, rb_encoding *enc) *ptr = 0; done = 1; } + slashes = 0; break; case L'*': ``` https://github.com/ruby/ruby/pull/17943 -- https://bugs.ruby-lang.org/
participants (1)
-
mame (Yusuke Endoh)