diff --git a/contrib/libreadline/complete.c b/contrib/libreadline/complete.c index 90bd87092248..552cb6c63802 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 @@ -1544,9 +1546,6 @@ rl_strpbrk (string1, string2) { register char *scan; - if (string2 == NULL) - return ((char *)NULL); - for (; *string1; string1++) { for (scan = string2; *scan; scan++) diff --git a/contrib/libreadline/readline.h b/contrib/libreadline/readline.h index bf6c9448c972..de2a0385c3bf 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;