This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


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

committing patch to fix ar w/no arguments



I'll commit this, then, as an obvious fix.  Quickly tested on
powerpc-linux.

-- 
- Geoffrey Keating <geoffk@cygnus.com>

===File ~/patches/cygnus/rs6000-binu-noX.patch==============
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/binutils/ChangeLog,v
retrieving revision 1.195
diff -p -u -u -p -r1.195 ChangeLog
--- ChangeLog	2000/08/08 00:47:04	1.195
+++ ChangeLog	2000/08/11 18:07:20
@@ -1,3 +1,8 @@
+2000-08-11  Geoff Keating  <geoffk@cygnus.com>
+
+	* ar.c (main): Don't crash if called with no arguments
+	or only '-X32_64' as an argument.
+
 2000-08-05  Jason Eckhardt  <jle@cygnus.com>
 
 	* readelf.c (elf/i860.h): Include.
Index: ar.c
===================================================================
RCS file: /cvs/src/src/binutils/ar.c,v
retrieving revision 1.17
diff -p -u -u -p -r1.17 ar.c
--- ar.c	2000/07/27 01:39:45	1.17
+++ ar.c	2000/08/11 18:07:23
@@ -437,7 +437,7 @@ main (argc, argv)
      of object files in the archive (the 64-bit objects
      or the 32-bit objects).  GNU ar always looks at all
      kinds of objects in an archive.  */
-  while (strcmp (argv[1], "-X32_64") == 0)
+  while (argc > 1 && strcmp (argv[1], "-X32_64") == 0)
     {
       argv++;
       argc--;
============================================================

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