Patch to prevent tilde crashing readline

Martin Simmons
2005-07-02T22:49:09Z

Here is a patch to the gdb readline to fix a typo in the MinGW changes. The
current CVS gdb segfaults on x86_64 FC3 Linux whenever ~ is used, e.g.

source ~martin/my-commands

The segfault is in strlen(), called from tilde_expand(), because
tilde_expand_word() returns NULL when HAVE_GETPWNAM is not defined
(i.e. always!). Someone should fix tilde_expand_word() to do the existing
else clause in this case.

Please CC me on any replies as I am not subscribed.

--
Martin Simmons

Index: readline/configure
===================================================================
RCS file: /cvs/src/src/readline/configure,v
retrieving revision 1.10
diff -u -r1.10 configure
--- readline/configure 9 May 2005 19:42:02 -0000 1.10
+++ readline/configure 29 Jun 2005 11:56:07 -0000
@@ -4139,7 +4139,7 @@

for ac_func in fcntl kill lstat memmove putenv select setenv setlocale \
strcasecmp strpbrk tcgetattr vsnprintf isascii isxdigit \
- getpwname getpwent getpwuid
+ getpwnam getpwent getpwuid
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
Index: readline/configure.in
===================================================================
RCS file: /cvs/src/src/readline/configure.in,v
retrieving revision 1.7
diff -u -r1.7 configure.in
--- readline/configure.in 9 May 2005 19:42:03 -0000 1.7
+++ readline/configure.in 29 Jun 2005 11:56:07 -0000
@@ -120,7 +120,7 @@

AC_CHECK_FUNCS(fcntl kill lstat memmove putenv select setenv setlocale \
strcasecmp strpbrk tcgetattr vsnprintf isascii isxdigit \
- getpwname getpwent getpwuid)
+ getpwnam getpwent getpwuid)

AC_FUNC_STRCOLL