[Issue 3120] New: std.process.execv() pass arguments to programm incorrectly

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 1 04:27:18 PDT 2009


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

           Summary: std.process.execv() pass arguments to programm
                    incorrectly
           Product: D
           Version: 2.030
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: golovanov_alexey at mail.ru


Phobos in DMD 2.030 and DMD 1.045 on Windows XP SP3:

function std.process.execv(in string pathname, in immutable(char)[][] argv)
don't pass argv parameters to executed program correctly. First element of argv
not passed (replaced by program name, or removed).

Short example - caller.exe should run called.exe with parameters "arg1",
"arg2", "arg3", then called.exe should save passed parameters into log file:

/*** begin file caller.d */
import std.process;

void main()
{
  string[] args = ["arg1", "arg2", "arg3"];
  std.process.execv("called.exe", args);
}
/*** end file caller.d */


/*** begin file called.d */
import std.file;
import std.string;

void main(string[] args)
{
  string s = std.string.join(args, " ");
  std.file.write("called.log", s);
}
/*** end file called.d */

In Windiws XP environment called.log will contain line:
"called.exe arg2 arg3"

but expected:
"called.exe arg1 arg2 arg3"

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list