Time to upgrade to bash-2.05b?

Greg Schafer gschafer at zip.com.au
Wed Jan 1 12:44:32 PST 2003


Hi

Everyone else on the planet has upgraded to bash-2.05b. Sure it was pretty
buggy when first released. The current patches make it pretty damn stable.

There is of course the issue of it segfaulting when configuring binutils
(but only when statically linked and and when called as /bin/sh and only for
some people - not everyone). As I've noted before, this can be worked around
by passing:-

  --without-bash-malloc

to the Ch 5 static bash.

IMHO, we should upgrade (and include the switch mentioned above as a
workaround). I've been building LFS's this way for a few months now without
problem.

I've taken the current patches and combined them into the 1 patch which I've
attached.

Greg
-------------- next part --------------
diff -uNr bash-2.05b.orig/bashline.c bash-2.05b/bashline.c
--- bash-2.05b.orig/bashline.c	2002-05-08 05:52:42.000000000 +1000
+++ bash-2.05b/bashline.c	2002-10-25 19:55:07.000000000 +1000
@@ -1044,7 +1044,10 @@
 	}
       else
 	{
+#define CMD_IS_DIR(x)	(absolute_pathname(x) == 0 && *(x) != '~' && test_for_directory (x))
+
 	  matches = rl_completion_matches (text, command_word_completion_function);
+
 	  /* If we are attempting command completion and nothing matches, we
 	     do not want readline to perform filename completion for us.  We
 	     still want to be able to complete partial pathnames, so set the
@@ -1052,7 +1055,7 @@
 	     filenames and leave directories in the match list. */
 	  if (matches == (char **)NULL)
 	    rl_ignore_some_completions_function = bash_ignore_filenames;
-	  else if (matches[1] == 0 && *matches[0] != '/')
+	  else if (matches[1] == 0 && CMD_IS_DIR(matches[0]))
 	    /* Turn off rl_filename_completion_desired so readline doesn't
 	       append a slash if there is a directory with the same name
 	       in the current directory, or other filename-specific things.
@@ -1061,7 +1064,7 @@
 	       looking in the current directory anyway, so there's no
 	       conflict. */
 	    rl_filename_completion_desired = 0;
-	  else if (matches[0] && matches[1] && STREQ (matches[0], matches[1]) && *matches[0] != '/')
+	  else if (matches[0] && matches[1] && STREQ (matches[0], matches[1]) && CMD_IS_DIR (matches[0]))
 	    /* There are multiple instances of the same match (duplicate
 	       completions haven't yet been removed).  In this case, all of
 	       the matches will be the same, and the duplicate removal code
diff -uNr bash-2.05b.orig/lib/readline/bind.c bash-2.05b/lib/readline/bind.c
--- bash-2.05b.orig/lib/readline/bind.c	2002-01-25 03:15:52.000000000 +1100
+++ bash-2.05b/lib/readline/bind.c	2002-10-25 19:55:00.000000000 +1000
@@ -311,7 +311,7 @@
 	     mapped to something, `abc' to be mapped to something else,
 	     and the function bound  to `a' to be executed when the user
 	     types `abx', leaving `bx' in the input queue. */
-	  if (k.function /* && k.type == ISFUNC */)
+	  if (k.function && ((k.type == ISFUNC && k.function != rl_do_lowercase_version) || k.type == ISMACR))
 	    {
 	      map[ANYOTHERKEY] = k;
 	      k.function = 0;
diff -uNr bash-2.05b.orig/lib/readline/readline.c bash-2.05b/lib/readline/readline.c
--- bash-2.05b.orig/lib/readline/readline.c	2002-03-14 09:10:46.000000000 +1100
+++ bash-2.05b/lib/readline/readline.c	2002-10-25 19:55:03.000000000 +1000
@@ -684,6 +684,7 @@
     }
 #if defined (VI_MODE)
   if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap &&
+      key != ANYOTHERKEY &&
       _rl_vi_textmod_command (key))
     _rl_vi_set_last (key, rl_numeric_arg, rl_arg_sign);
 #endif
diff -uNr bash-2.05b.orig/subst.c bash-2.05b/subst.c
--- bash-2.05b.orig/subst.c	2002-06-24 21:59:45.000000000 +1000
+++ bash-2.05b/subst.c	2002-10-25 19:55:11.000000000 +1000
@@ -1638,11 +1638,10 @@
 
 /* This performs word splitting and quoted null character removal on
    STRING. */
-#if 0
-#define issep(c)	((separators)[1] ? (member ((c), separators)) : (c) == (separators)[0])
-#else
-#define issep(c)	((separators)[1] ? isifs(c) : (c) == (separators)[0])
-#endif
+#define issep(c) \
+	(((separators)[0]) ? ((separators)[1] ? isifs(c) \
+					      : (c) == (separators)[0]) \
+			   : 0)
 
 WORD_LIST *
 list_string (string, separators, quoted)


More information about the lfs-dev mailing list