[Issue 845] New: dmd -run does not correctly pass command line arguments
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Jan 13 09:08:05 PST 2007
http://d.puremagic.com/issues/show_bug.cgi?id=845
Summary: dmd -run does not correctly pass command line arguments
Product: D
Version: 1.00
Platform: PC
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: lio at lunesu.com
The following test cases:
%1 "2nd\" 3rd
%1 2nd\" 3rd
%1 "2nd\"" 3rd
%1 2nd\"" 3rd
%1 "2nd\""" 3rd
result in different arguments passed to main:
import std.stdio;
void main(char[]args[]) {
foreach(a;args[1..$]) writefln(a); }
Results, commas used as new-line:
dmd -run:
2 args: 2nd,3rd
1 arg: 2nd 3rd
1 arg: 2nd 3rd
2 args: 2nd,3rd
2 args: 2nd,3rd
(notice how all quotes are gone)
First dmd, then run:
1 arg: 2nd" 3rd
2 args: 2nd",3rd
2 args: 2nd",3rd
1 arg: 2nd" 3rd
1 arg: 2nd" 3rd
For the record, the last test case
%1 "2nd\""" 3rd
results in different arguments for dmd(dmc) and msvc7 and msvc8.
dmd/dmc, 1 arg: 2nd" 3rd
msvc7, 2 args: 2nd"",3rd
msvc8, 1 arg: 2nd"" 3rd
--
More information about the Digitalmars-d-bugs
mailing list