mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-07 12:20:50 +02:00
commit bash-20210203 snapshot
This commit is contained in:
@@ -1207,13 +1207,36 @@ history_expand (char *hstring, char **output)
|
||||
characters in history_no_expand_chars, then it is not a
|
||||
candidate for expansion of any kind. */
|
||||
if (cc == 0 || member (cc, history_no_expand_chars) ||
|
||||
(dquote && cc == '"') ||
|
||||
(history_inhibit_expansion_function && (*history_inhibit_expansion_function) (string, i)))
|
||||
(dquote && cc == '"'))
|
||||
{
|
||||
ADD_CHAR (string[i]);
|
||||
break;
|
||||
}
|
||||
|
||||
/* If the application has defined a function to determine whether
|
||||
or not a history expansion should be performed, call it here. */
|
||||
/* We check against what we've expanded so far, with the current
|
||||
expansion appended, because that seems to be what csh does. We
|
||||
decide to expand based on what we have to this point, not what
|
||||
we started with. */
|
||||
if (history_inhibit_expansion_function)
|
||||
{
|
||||
int save_j, temp;
|
||||
|
||||
save_j = j;
|
||||
ADD_CHAR (string[i]);
|
||||
ADD_CHAR (cc);
|
||||
|
||||
temp = (*history_inhibit_expansion_function) (result, save_j);
|
||||
if (temp)
|
||||
{
|
||||
result[--j] = '\0'; /* `unadd' cc, leaving ADD_CHAR(string[i]) */
|
||||
break;
|
||||
}
|
||||
else
|
||||
result[j = save_j] = '\0';
|
||||
}
|
||||
|
||||
#if defined (NO_BANG_HASH_MODIFIERS)
|
||||
/* There is something that is listed as a `word specifier' in csh
|
||||
documentation which means `the expanded text to this point'.
|
||||
|
||||
Reference in New Issue
Block a user