bug in argz_insert

Jeff Johnston jjohnstn@redhat.com
Thu Sep 8 21:08:00 GMT 2005


Thanks Eric.  Patch checked in.

-- Jeff J.

Eric Blake wrote:
> 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;
> 
> 



More information about the Newlib mailing list