Project

General

Profile

Actions

Bug #10973

closed

Silent failure when launching ruby with command line parameters for script that matches directory and contains [

Added by ts (Thomas Sondergaard) over 9 years ago. Updated over 9 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.1p85 (2015-02-26 revision 49769) [x64-mingw32]
[ruby-core:<unknown>]

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.

Actions

Also available in: Atom PDF

Like0
Like0