This is the mail archive of the
cygwin
mailing list for the Cygwin project.
argv[0] drops extension?
- From: Brian Ford <ford at vss dot fsi dot com>
- To: cygwin at cygwin dot com
- Date: Fri, 17 Sep 2004 17:00:39 -0500
- Subject: argv[0] drops extension?
- Reply-to: cygwin at cygwin dot com
$ uname -a
CYGWIN_NT-5.1 fordpc 1.5.12(0.116/4/2) 2004-09-16 11:17 i686 unknown
unknown Cygwin
$ cat argv.c
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int
main(int argc, char *argv[])
{
printf("argv[0]: %s\n", argv[0]);
if (open(argv[0], O_RDONLY|O_BINARY) < 0)
perror("open");
return 0;
}
$ gcc -o argv.exe -g -O2 argv.c
$ ./argv
argv[0]: ./argv
open: No such file or directory
$ ./argv.exe
argv[0]: ./argv
open: No such file or directory
Is this expected behavior? Thanks.
--
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
the best safety device in any aircraft is a well-trained pilot...
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/