From 38f8cb6930cb8fa152751da4a4b87b7847c6ecbd Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Mon, 4 Feb 2019 08:55:56 -0500 Subject: [PATCH] commit bash-20190201 snapshot --- CWRU/CWRU.chlog | 15 +++++++++++++++ lib/glob/glob_loop.c | 4 ++-- lib/readline/readline.c | 8 +++++++- tests/RUN-ONE-TEST | 2 +- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index 05ff6e463..e56fb5c6a 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -5190,3 +5190,18 @@ pathexp.c a backslash that will trigger a call to shell_glob_filename, since backslashes at the end of patterns (pathname components) will always fail to match. XXX - this is provisional + +lib/glob/glob.c + - glob_filename: if we have a directory name that has no unquoted + special glob chars, but has backslashes, just dequote it and return + it without going through the rest of the glob expansions. Partial + fix for issue with unreadable directories reported by + Andrew Church + + 2/2 + --- +lib/readline/readline.c + - readline_internal_teardown: if revert-all-at-newline is set, make + sure that the history position is at the end of the history before + calling _rl_revert_all_lines(). Fixes bug reported by + johnlinp@gmail.com and frederik@ofb.net diff --git a/lib/glob/glob_loop.c b/lib/glob/glob_loop.c index 6062f2f9f..3a4f4f1e8 100644 --- a/lib/glob/glob_loop.c +++ b/lib/glob/glob_loop.c @@ -64,10 +64,10 @@ INTERNAL_GLOB_PATTERN_P (pattern) { p++; bsquote = 1; + continue; } - else if (*p == L('\0')) + else /* (*p == L('\0')) */ return 0; - continue; } return bsquote ? 2 : 0; diff --git a/lib/readline/readline.c b/lib/readline/readline.c index 678f989c5..22acad79a 100644 --- a/lib/readline/readline.c +++ b/lib/readline/readline.c @@ -458,6 +458,7 @@ readline_internal_teardown (int eof) { char *temp; HIST_ENTRY *entry; + int pos; RL_CHECK_SIGNALS (); @@ -477,7 +478,12 @@ readline_internal_teardown (int eof) } if (_rl_revert_all_at_newline) - _rl_revert_all_lines (); + { + pos = where_history (); + using_history (); + _rl_revert_all_lines (); + history_set_pos (pos); + } /* At any rate, it is highly likely that this line has an undo list. Get rid of it now. */ diff --git a/tests/RUN-ONE-TEST b/tests/RUN-ONE-TEST index 554f3d6ec..58c375b70 100755 --- a/tests/RUN-ONE-TEST +++ b/tests/RUN-ONE-TEST @@ -1,4 +1,4 @@ -BUILD_DIR=/usr/local/build/bash/bash-current +BUILD_DIR=/usr/local/build/chet/bash/bash-current THIS_SH=$BUILD_DIR/bash PATH=$PATH:$BUILD_DIR -- 2.47.2