Bug 6129 – dmd -run passes incorrect argv[0] to application
Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2011-06-08T14:28:00Z
Last change time
2016-10-14T15:35:30Z
Assigned to
nobody
Creator
robert
Comments
Comment #0 by robert — 2011-06-08T14:28:12Z
The following:
----
#!/usr/bin/env dmd -run
void main(string[] args)
{
assert(args[0] == "./foo/bar.d");
}
----
When invoked using ./foo/bar.d fails. dmd should propagate the command to the application, rather than using the module name.
Comment #1 by andrej.mitrovich — 2013-02-09T06:22:01Z
args[0] is typically the executable name, not the source name, I don't see how that's wrong?