digitalmars.D.bugs - [Issue 505] New: rdmd and dmd do not correctly preserve program arguments with spaces.
- d-bugmail puremagic.com (27/27) Nov 14 2006 http://d.puremagic.com/issues/show_bug.cgi?id=505
- d-bugmail puremagic.com (35/35) Nov 14 2006 http://d.puremagic.com/issues/show_bug.cgi?id=505
- d-bugmail puremagic.com (9/9) Dec 08 2006 http://d.puremagic.com/issues/show_bug.cgi?id=505
http://d.puremagic.com/issues/show_bug.cgi?id=505
Summary: rdmd and dmd do not correctly preserve program arguments
with spaces.
Product: D
Version: 0.173
Platform: PC
OS/Version: Windows
Status: NEW
Severity: critical
Priority: P1
Component: DMD
AssignedTo: bugzilla digitalmars.com
ReportedBy: brunodomedeiros+bugz gmail.com
rdmd and dmd do not correctly preserve program arguments with spaces. With a
test program that prints args.length and args[1] :
$ test.exe "a b c" d
args.length: 3
args[1]: a b c
$ rdmd test.d "a b c" d
args.length: 5
args[1]: a
$ dmd -run test.d "a b c" d
args.length: 5
args[1]: a
Note: I actually depend on this in some scripts of mine which I use often, and
which this bug breaks in many situations :(
--
Nov 14 2006
http://d.puremagic.com/issues/show_bug.cgi?id=505
godaves yahoo.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|rdmd and dmd do not |rdmd and dmd do not
|correctly preserve program |correctly preserve program
|arguments with spaces. |arguments with spaces.
Linux works fine.
Here's a fix for rdmd on windows (line 104):
version (Windows)
{
exeargv ~= "\"" ~ exepath ~ "\"";
foreach(char[] arg; argv) exeargv ~= "\"" ~ arg ~ "\"";
}
else
{
exeargv ~= exepath;
foreach(char[] arg; argv) exeargv ~= arg;
}
Before the fix:
C:\Zz>rdmd_win test.d "1 2 3" 4 "567"
args.length: 6
args[1]: 1
args[2]: 2
args[3]: 3
args[4]: 4
args[5]: 567
After:
C:\Zz>rdmd_win test.d "1 2 3" 4 "567"
args.length: 4
args[1]: 1 2 3
args[2]: 4
args[3]: 567
--
Nov 14 2006
http://d.puremagic.com/issues/show_bug.cgi?id=505
bugzilla digitalmars.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Fixed DMD 0.176
--
Dec 08 2006









d-bugmail puremagic.com 