[Issue 505] rdmd and dmd do not correctly preserve program arguments with spaces.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 14 19:38:30 PST 2006


http://d.puremagic.com/issues/show_bug.cgi?id=505


godaves at 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.




------- Comment #1 from godaves at yahoo.com  2006-11-14 21:38 -------
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


-- 




More information about the Digitalmars-d-bugs mailing list