Mail Archives: djgpp-workers/2000/08/21/02:43:18
> Date: Sun, 20 Aug 2000 20:36:31 +0200
> From: Laurynas Biveinis <lauras AT softhome DOT net>
>
> I've following little problem:
> should this code pass argv[0] as 'args.exe'?
>
> symlink("args.exe", "linkargs.exe");
> spawnl(P_WAIT, "linkargs.exe", "args.exe", "oh", "well", NULL);
It should, but it can't, in general.
> If yes, (I assumed that), then the following code in go32_exec() worries me:
>
> save_argv0 = argv[0];
> argv[0] = unconst(program, char *); /* since that's where we really found it */
>
> Could anyone put some light on this?
This is documented on spawn's Info page: DOS cannot pass argv0
separately, so the third argument to spawnl is generally ignored.
We could have arranged to pass the correct argv0 when we invoke
programs the DJGPP way (via !proxy), but that would create subtle
differences with the case when a program is invoked via the shell, or
by `system'. So we leave this alone.
FWIW, I've never seen code which uses the possibility of passing argv0
which is different from the program's basename.
- Raw text -