This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

bug in argz_insert


argz_insert is supposed to place entry at the end of argz when before is NULL, 
rather than dying with EINVAL.  This bug is breaking CVS head m4 on cygwin, 
since CVS head libtool makes use of argz_insert in this manner.

2005-09-08  Eric Blake  <ebb9@byu.net>

	* libc/argz/argz_insert.c (argz_insert): Don't die with EINVAL when
	before is NULL.

Index: argz/argz_insert.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/argz/argz_insert.c,v
retrieving revision 1.2
diff -u -b -r1.2 argz_insert.c
--- argz/argz_insert.c  6 Jun 2003 19:57:51 -0000       1.2
+++ argz/argz_insert.c  8 Sep 2005 20:37:10 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 by  Red Hat, Incorporated. All rights reserved.
+/* Copyright (C) 2002, 2005 by  Red Hat, Incorporated. All rights reserved.
  *
  * Permission to use, copy, modify, and distribute this software
  * is freely granted, provided that this notice is preserved.
@@ -20,7 +20,7 @@
   int len = 0;
 
   if (before == NULL)
-    argz_add(argz, argz_len, entry);
+    return argz_add(argz, argz_len, entry);
 
   if (before < *argz || before >= *argz + *argz_len)
     return EINVAL;



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