This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
gcc driver crash fix
- To: egcs-patches at egcs dot cygnus dot com
- Subject: gcc driver crash fix
- From: Mumit Khan <khan at xraylith dot wisc dot EDU>
- Date: Tue, 09 Feb 1999 17:29:40 -0600
This patch fixes a crash on hosts that define EXECUTABLE_SUFFIX or
OBJECT_SUFFIX; eg., on Win32, the following crashes the driver:
$ gcc -o
Now instead it reports:
gcc: argument to `-o' is missing
Tue Feb 9 16:52:22 1999 Mumit Khan <khan@xraylith.wisc.edu>
* gcc.c (convert_filename): Handle null filename argument.
Index: gcc.c
===================================================================
RCS file: /mounts/sda7/src/gnu/CVSROOT/egcs-dev/gcc/gcc.c,v
retrieving revision 1.1.1.1
diff -u -3 -p -r1.1.1.1 gcc.c
--- gcc.c 1999/02/07 23:35:12 1.1.1.1
+++ gcc.c 1999/02/09 22:52:01
@@ -2393,7 +2393,12 @@ convert_filename (name, do_exe)
int do_exe;
{
int i;
- int len = strlen (name);
+ int len;
+
+ if (name == NULL)
+ return NULL;
+
+ len = strlen (name);
#ifdef HAVE_OBJECT_SUFFIX
/* Convert x.o to x.obj if OBJECT_SUFFIX is ".obj". */