oneclick / rubyinstaller2

MSYS2 based RubyInstaller for Windows
https://rubyinstaller.org
BSD 3-Clause "New" or "Revised" License
644 stars 248 forks source link

Single quotation marks in command line arguments. #343

Closed carlzhc closed 6 months ago

carlzhc commented 1 year ago

What problems are you experiencing?

Ruby wrongly handles command line arguments with single quotation marks in MSYS environment.

Steps to reproduce

$ /d/Ruby32-x64/bin/ruby -v
ruby 3.2.1 (2023-02-08 revision 31819e82c8) [x64-mingw-ucrt]

$ /d/Ruby32-x64/bin/ruby -e "puts ARGV" "A''''B"
AB

What's the output from ridk version?

N.A.

mohits commented 11 months ago

That's strange. I'm on Ruby 3.2.0 on Windows 10, and it seems correct?

$ ruby -v
ruby 3.2.0 (2022-12-25 revision a528908271) [x64-mingw-ucrt]

$ ruby -e "puts ARGV" "A''''B"
A''''B
carlzhc commented 10 months ago

Maybe you used the ruby from msys system, not the one installed by rubyinstaller.

$ /usr/bin/printf "%s\n" "A''''B"
A''''B

$ /usr/bin/ruby -e "puts ARGV" "A''''B"
A''''B

$ /d/Ruby32-x64/bin/ruby -e "puts ARGV" "A''''B"
AB
MSP-Greg commented 10 months ago

I tried this with the example and also with single and double flipped.

Tried four shells. cmd shell parses both, all the others behave the same.

Using: ruby 3.3.0dev (2023-08-23T04:56:51Z master e89150b1d4) [x64-mingw-ucrt]

                     ———————————————— Arguments ————————————————
                     "puts ARGV" "A''''B"   'puts ARGV' 'A""""B'
Shell
cmd                        A''''B                 A""""B
PowerShell                 AB                     A""""B
MSYS2 Bash                 AB                     A""""B
Git Bash                   AB                     A""""B
mohits commented 6 months ago

hi @carlzhc - sorry for the late reply. I used command prompt but I have modified the prompt to look different which is why it seemed like it was bash.

Do you still see this? Would you like to keep this open or close it? Thanks.

carlzhc commented 6 months ago

Hi Mohit,

thanks for reply.

If you cannot reproduce the errors, it seems my environment issue, but I cannot find the cause till now.

Please close the ticket, thanks.

Mohit Sindhwani @.***> 于 2023年12月28日周四 下午2:58写道:

hi @carlzhc https://github.com/carlzhc - sorry for the late reply. I used command prompt but I have modified the prompt to look different which is why it seemed like it was bash.

Do you still see this? Would you like to keep this open or close it? Thanks.

— Reply to this email directly, view it on GitHub https://github.com/oneclick/rubyinstaller2/issues/343#issuecomment-1870880500, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADJPS4HOFNNXL24EX5ZOEALYLUKAVAVCNFSM6AAAAAAZBTBDKWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZQHA4DANJQGA . You are receiving this because you were mentioned.Message ID: @.***>