This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gcc driver crash fix



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".  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]