Mail Archives: djgpp-workers/1999/08/06/12:26:05
If I run a program and the program name is in the '/dev/' format, shouldn't argv[0]
be converted to regular DOS format (c:/djgpp/bin...)? The source does convert the
program to c:/... form, but not until after the path has been copied to argv[0]. Is
this intentional or is this a bug?
Here's how I tested:
test parent program:
#include <process.h>
int main()
{
spawnl(P_WAIT, "/dev/c/djgpp/bin/argv0.exe", "c:/djgpp/bin/argv0.exe", NULL);
return 0;
}
test child program, argv0:
#include <stdio.h>
int main(int argc, char **argv)
{
printf("argv0: %s\n", argv[0]);
}
You will find that argv[0] will be in the '/dev/' form.
---
Mark Elbrecht, snowball3 AT bigfoot DOT com
http://snowball.frogspace.net/
- Raw text -