BUG: rdmd cmd line argument bug

Dave Dave_member at pathlink.com
Mon May 29 11:05:31 PDT 2006


In article <e5c3t9$2vvq$1 at digitaldaemon.com>, Bruno Medeiros says...
>
>The Windows version of rdmd passes incorrect command line arguments to 
>the program to be run. Here's a test program:
>
>   import std.stdio;
>
>   int main(char[][] args) {
>     writefln("ARGS: ", args.length, " ", args);
>     return 0;
>   }
>
>Here's a correct run with dmd (the program gets the correct args):
>
>$ dmd -run ./printargs.d AA BB CC
>ARGS: 4 [d:\#scripts\printargs.exe,AA,BB,CC]
>
>Here's what happens when you run the same program with rdmd:
>
>$ rdmd -run ./printargs.d AA BB CC
>ARGS: 3 
>[d:\#scripts\printargs.exe,-ofc:/Home/phoenix/LOCALS~1/Temp\-phoenix-0-0
>-523934D89A617F8383F6035B5D2CC826.exe,-odc:/Home/phoenix/LOCALS~1/Temp\]
>
>The Linux version of rdmd seems to run fine (I haven't tested myself, I 
>asked someone else on #D)
>

rdmd doesn't need '-run'. If I run it with the above code, I get this on linux:

ARGS: 4 [/tmp/rd-0-834-509947-D7B8821E97DC98D3C34D2F29E2EE2115,AA,BB,CC]

and this on Windows:

ARGS: 4
[C:\DOCUME~1\SOMEUS~1\LOCALS~1\Temp\rd-someuser-0-0-A46C236CDE107E3B9F053881E4257C2D.exe,AA,BB,CC]

(the line-break was inserted by the news reader)

args[0] is the actual path to the 'cached' executable.





More information about the Digitalmars-d-bugs mailing list