* libltdl/ltdl.c (lt_argz_insert): Work around newlib argz_insert bug. * libltdl/Makefile.am (libltdl_la_LDFLAGS): Bumped revision. Reported by Eric Blake . Index: libltdl/Makefile.am =================================================================== RCS file: /cvsroot/libtool/libtool/libltdl/Attic/Makefile.am,v retrieving revision 1.42.2.9 diff -u -r1.42.2.9 Makefile.am --- libltdl/Makefile.am 31 Aug 2005 18:54:17 -0000 1.42.2.9 +++ libltdl/Makefile.am 14 Sep 2005 16:07:00 -0000 @@ -18,7 +18,7 @@ CLEANFILES = libltdl.la libltdlc.la libltdl_la_SOURCES = ltdl.c -libltdl_la_LDFLAGS = -no-undefined -version-info 4:2:1 +libltdl_la_LDFLAGS = -no-undefined -version-info 4:3:1 libltdl_la_LIBADD = $(LIBADD_DL) libltdlc_la_SOURCES = ltdl.c Index: libltdl/ltdl.c =================================================================== RCS file: /cvsroot/libtool/libtool/libltdl/ltdl.c,v retrieving revision 1.174.2.18 diff -u -r1.174.2.18 ltdl.c --- libltdl/ltdl.c 3 Aug 2005 14:04:22 -0000 1.174.2.18 +++ libltdl/ltdl.c 14 Sep 2005 16:07:00 -0000 @@ -1,5 +1,5 @@ /* ltdl.c -- system independent dlopen wrapper - Copyright (C) 1998, 1999, 2000, 2004 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2004, 2005 Free Software Foundation, Inc. Originally by Thomas Tanner This file is part of GNU Libtool. @@ -3552,7 +3552,14 @@ { error_t error; - if ((error = argz_insert (pargz, pargz_len, before, entry))) + /* Prior to Sep 8, 2005, newlib had a bug where argz_insert(pargz, + pargz_len, NULL, entry) failed with EINVAL. */ + if (before) + error = argz_insert (pargz, pargz_len, before, entry); + else + error = argz_append (pargz, pargz_len, entry, 1 + LT_STRLEN (entry)); + + if (error) { switch (error) {