summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2018-09-17 15:10:56 -0400
committerChet Ramey <chet.ramey@case.edu>2018-09-17 15:10:56 -0400
commit2f5dfe5a18b4670eb4cea32c1c76295eb70a8865 (patch)
treebf19e42dcaf6c5cf8e0ce0a1c15d56e8f8a6d675 /parse.y
parent9a51695bed07d37086c352372ac69d0a30039a6b (diff)
downloadbash-5.0-beta.tar.gz
bash-5.0-beta releasebash-5.0-beta
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y18
1 files changed, 13 insertions, 5 deletions
diff --git a/parse.y b/parse.y
index 6457782b..0eb64130 100644
--- a/parse.y
+++ b/parse.y
@@ -2414,20 +2414,21 @@ shell_getc (remove_quoted_newline)
{
char *expansions;
# if defined (BANG_HISTORY)
- int old_hist;
-
/* If the current delimiter is a single quote, we should not be
performing history expansion, even if we're on a different
line from the original single quote. */
- old_hist = history_expansion_inhibited;
if (current_delimiter (dstack) == '\'')
- history_expansion_inhibited = 1;
+ history_quoting_state = '\'';
+ else if (current_delimiter (dstack) == '"')
+ history_quoting_state = '"';
+ else
+ history_quoting_state = 0;
# endif
/* Calling with a third argument of 1 allows remember_on_history to
determine whether or not the line is saved to the history list */
expansions = pre_process_line (shell_input_line, 1, 1);
# if defined (BANG_HISTORY)
- history_expansion_inhibited = old_hist;
+ history_quoting_state = 0;
# endif
if (expansions != shell_input_line)
{
@@ -3167,6 +3168,13 @@ reset_parser ()
token_to_read = '\n';
}
+void
+reset_readahead_token ()
+{
+ if (token_to_read == '\n')
+ token_to_read = 0;
+}
+
/* Read the next token. Command can be READ (normal operation) or
RESET (to normalize state). */
static int