summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/hist.c7
-rw-r--r--Src/lex.c1
3 files changed, 13 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index dd5012fbf..b0f838d5c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2021-07-23 Peter Stephenson <p.w.stephenson@ntlworld.com>
+
+ * 49182: Src/hist.c, Src/lex.c: Interactive word correction
+ doesn't work inside command substitution, so don't try to do it.
+
2021-07-19 Eric Cook <llua@gmx.com>
* 49147: Completion/Linux/Command/_modutils: fix the completion
diff --git a/Src/hist.c b/Src/hist.c
index 42cae030c..6ac581fda 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -339,6 +339,13 @@ hist_in_word(int yesno)
histactive &= ~HA_INWORD;
}
+/**/
+int
+hist_is_in_word(void)
+{
+ return (histactive & HA_INWORD) ? 1 : 0;
+}
+
/* add a character to the current history word */
static void
diff --git a/Src/lex.c b/Src/lex.c
index 37fcec3e2..ece02659e 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -1889,6 +1889,7 @@ exalias(void)
hwend();
if (interact && isset(SHINSTDIN) && !strin && incasepat <= 0 &&
tok == STRING && !nocorrect && !(inbufflags & INP_ALIAS) &&
+ !hist_is_in_word() &&
(isset(CORRECTALL) || (isset(CORRECT) && incmdpos)))
spckword(&tokstr, 1, incmdpos, 1);