Mail Archives: djgpp-workers/1999/09/30/16:55:58
Eli Zaretskii wrote:
> Try the modified test.c below, and you will see the long file name in
> argv[0].
But the puzzle doesn't end, I have:
file test.c:
#include <stdlib.h>
int main(void)
{
system("VeryLongName.exe"
" 1234567890 1234567890 1234567890 1234567890 234567890"
/* " 1234567890 1234567890 1234567890 1234567890 1234567890"
" 1234567890 1234567890" */);
return 0;
}
-----------
file VeryLongName.c:
-----------
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("Hello from VeryLongName.exe!\n");
printf("%s\n", argv[0]);
return 0;
}
-----------
If I run test, I get:
Hello from VeryLongName.exe!
c:/djgpp/programs/djgpp/verylong.exe
Correct. But If delete '/*' and '*/' from test.c to
enable long command line, I get:
Hello from VeryLongName.exe!
And argv[0] is _not_ printed.
Is this expected behaviour ?
Laurynas Biveinis
- Raw text -