Bug #10973
closedSilent failure when launching ruby with command line parameters for script that matches directory and contains [
Description
I have a script that passes a regular expression to a ruby script that matches a file path. This regular expression contains the character '['. After upgrading from ruby 2.0.0 to ruby 2.2.1 on Windows ruby no longer works when a script is passed a command line argument that partially matches a directory and contains the character '['. See the following example:
First example: Current working dir is D:\ and 'D:\foo' doesn't exist. The script executes without incident:
d:>ruby -e "puts 'hello'" D:/foo/bar/[
hello
d:>echo %errorlevel%
0
Second example: Same current working directory and same command, only now there is a directory D:\foo:
d:>mkdir foo
d:>ruby -e "puts 'hello'" D:/foo/bar/[
d:>echo %errorlevel%
-1073741819
This is a regression from earlier version of ruby. I have not tested on other platforms than Windows.