From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elena Zannoni To: Eli Zaretskii Cc: gdb@sources.redhat.com, ac131313@cygnus.com Subject: Re: DOS/Windows-specific code: exec.c and symfile.c Date: Tue, 08 May 2001 07:43:00 -0000 Message-id: <15096.1577.377737.127821@kwikemart.cygnus.com> References: <20010503211502.21716.qmail@web6401.mail.yahoo.com> <3AF1DAA0.3060702@cygnus.com> <200105071609.TAA24129@is.elta.co.il> <200105081143.OAA06186@is.elta.co.il> X-SW-Source: 2001-05/msg00122.html Eli Zaretskii writes: > > * exec.c:exec_file_attach() > > scratch_chan = openp (getenv ("PATH"), 1, filename, > write_files ? O_RDWR | O_BINARY : O_RDONLY | O_BINARY, 0, > &scratch_pathname); > #if defined(__GO32__) || defined(_WIN32) || defined(__CYGWIN__) > if (scratch_chan < 0) > { > char *exename = alloca (strlen (filename) + 5); > strcat (strcpy (exename, filename), ".exe"); > scratch_chan = openp (getenv ("PATH"), 1, exename, write_files ? > O_RDWR | O_BINARY : O_RDONLY | O_BINARY, 0, &scratch_pathname); > } > #endif > > This snippet wants to find `foo.exe' when `foo' is being specified. > Should we add a #define for executable extensions (defaulting to an > empty string on Unix)? > This seems like a good candidate for inclusion in filenames.h. Elena > > * symfile.c:symfile_bfd_open() > > /* Look down path for it, allocate 2nd new malloc'd copy. */ > desc = openp (getenv ("PATH"), 1, name, O_RDONLY | O_BINARY, 0, &absolute_name); > #if defined(__GO32__) || defined(_WIN32) > if (desc < 0) > { > char *exename = alloca (strlen (name) + 5); > strcat (strcpy (exename, name), ".exe"); > desc = openp (getenv ("PATH"), 1, exename, O_RDONLY | O_BINARY, > 0, &absolute_name); > } > #endif > > This is the same issue as in exec.c:exec_file_attach() above, and > should be solved in the same way. >