From 53ee3efdd804d38a5c57372c0722804607ceb256 Mon Sep 17 00:00:00 2001 From: ache Date: Thu, 6 Nov 1997 00:50:44 +0000 Subject: Update to current bash version --- contrib/libreadline/complete.c | 4 +++- contrib/libreadline/display.c | 7 ++++++- contrib/libreadline/histfile.c | 4 ++-- contrib/libreadline/isearch.c | 2 +- contrib/libreadline/readline.h | 2 +- contrib/libreadline/tilde.c | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) (limited to 'contrib') diff --git a/contrib/libreadline/complete.c b/contrib/libreadline/complete.c index b17c63e..552cb6c 100644 --- a/contrib/libreadline/complete.c +++ b/contrib/libreadline/complete.c @@ -796,7 +796,9 @@ make_quoted_replacement (match, mtype, qc) /* If there is a single match, see if we need to quote it. This also checks whether the common prefix of several matches needs to be quoted. */ - should_quote = rl_strpbrk (match, rl_filename_quote_characters) != 0; + should_quote = rl_filename_quote_characters + ? (rl_strpbrk (match, rl_filename_quote_characters) != 0) + : 0; do_replace = should_quote ? mtype : NO_MATCH; /* Quote the replacement, since we found an embedded diff --git a/contrib/libreadline/display.c b/contrib/libreadline/display.c index c283f9a..609d827 100644 --- a/contrib/libreadline/display.c +++ b/contrib/libreadline/display.c @@ -1482,7 +1482,7 @@ cr () void _rl_redisplay_after_sigwinch () { - char *t, *oldp; + char *t, *oldp, *oldl, *oldlprefix; /* Clear the current line and put the cursor at column 0. Make sure the right thing happens if we have wrapped to a new screen line. */ @@ -1508,9 +1508,14 @@ _rl_redisplay_after_sigwinch () if (t) { oldp = rl_display_prompt; + oldl = local_prompt; + oldlprefix = local_prompt_prefix; rl_display_prompt = ++t; + local_prompt = local_prompt_prefix = (char *)NULL; rl_forced_update_display (); rl_display_prompt = oldp; + local_prompt = oldl; + local_prompt_prefix = oldlprefix; } else rl_forced_update_display (); diff --git a/contrib/libreadline/histfile.c b/contrib/libreadline/histfile.c index c3de134..9f96f1c 100644 --- a/contrib/libreadline/histfile.c +++ b/contrib/libreadline/histfile.c @@ -246,7 +246,7 @@ history_truncate_file (fname, lines) /* Write only if there are more lines in the file than we want to truncate to. */ - if (i && ((file = open (filename, O_WRONLY|O_TRUNC|O_BINARY, 0666)) != -1)) + if (i && ((file = open (filename, O_WRONLY|O_TRUNC|O_BINARY, 0600)) != -1)) { write (file, buffer + i, finfo.st_size - i); close (file); @@ -275,7 +275,7 @@ history_do_write (filename, nelements, overwrite) mode = overwrite ? O_WRONLY|O_CREAT|O_TRUNC|O_BINARY : O_WRONLY|O_APPEND|O_BINARY; output = history_filename (filename); - if ((file = open (output, mode, 0666)) == -1) + if ((file = open (output, mode, 0600)) == -1) { FREE (output); return (errno); diff --git a/contrib/libreadline/isearch.c b/contrib/libreadline/isearch.c index 9639a63..ce2e58b 100644 --- a/contrib/libreadline/isearch.c +++ b/contrib/libreadline/isearch.c @@ -262,7 +262,7 @@ rl_search_history (direction, invoking_key) break; } - if (c >= 0 && (CTRL_CHAR (c) || META_CHAR (c) || c == RUBOUT)) + if (c >= 0 && (CTRL_CHAR (c) || META_CHAR (c) || c == RUBOUT) && c != CTRL ('g')) { rl_execute_next (c); break; diff --git a/contrib/libreadline/readline.h b/contrib/libreadline/readline.h index d6c1a5c..99ec055 100644 --- a/contrib/libreadline/readline.h +++ b/contrib/libreadline/readline.h @@ -255,7 +255,7 @@ extern int rl_pending_input; /* Non-zero if we called this function from _rl_dispatch(). It's present so functions can find out whether they were called from a key binding or directly from an application. */ -int rl_dispatching; +extern int rl_dispatching; /* The name of the terminal to use. */ extern char *rl_terminal_name; diff --git a/contrib/libreadline/tilde.c b/contrib/libreadline/tilde.c index 1d38d9d..fe263a2 100644 --- a/contrib/libreadline/tilde.c +++ b/contrib/libreadline/tilde.c @@ -189,7 +189,7 @@ tilde_expand (string) if (result = strchr (string, '~')) result = xmalloc (result_size = (strlen (string) + 16)); else - result = xmalloc (result_size = strlen (string)); + result = xmalloc (result_size = (strlen (string) + 1)); /* Scan through STRING expanding tildes as we come to them. */ while (1) -- cgit v1.1