diff options
author | Ron Yorston <rmy@pobox.com> | 2023-06-04 09:07:54 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2023-06-04 09:07:54 +0100 |
commit | a5d290b6b434c9dcc209da111b874659543cad45 (patch) | |
tree | 8b23d3c5bcebd25e3cac35e454cc9f44a94c95a6 | |
parent | bd7018350d7e816a90dde97fa0a4abf41be17b4d (diff) | |
download | busybox-w32-a5d290b6b434c9dcc209da111b874659543cad45.tar.gz busybox-w32-a5d290b6b434c9dcc209da111b874659543cad45.tar.bz2 busybox-w32-a5d290b6b434c9dcc209da111b874659543cad45.zip |
ash: fix build with line editing disabled
Commit 64c8f5f3d0 (ash: add support for INT trap) made some changes
to the line editing code. As a result building the shell with
line editing disabled fails.
Add the necessary conditional compilation to restore the ability
to do this.
-rw-r--r-- | shell/ash.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c index 7fa75721e..b29927a83 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -15242,14 +15242,18 @@ trapcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | |||
15242 | // trap '' INT disables Ctrl-C, anything else enables it | 15242 | // trap '' INT disables Ctrl-C, anything else enables it |
15243 | if (action && action[0] == '\0') { | 15243 | if (action && action[0] == '\0') { |
15244 | SetConsoleCtrlHandler(NULL, TRUE); | 15244 | SetConsoleCtrlHandler(NULL, TRUE); |
15245 | # if ENABLE_FEATURE_EDITING | ||
15245 | if (line_input_state) { | 15246 | if (line_input_state) { |
15246 | line_input_state->flags |= IGNORE_CTRL_C; | 15247 | line_input_state->flags |= IGNORE_CTRL_C; |
15247 | } | 15248 | } |
15249 | # endif | ||
15248 | } else { | 15250 | } else { |
15249 | SetConsoleCtrlHandler(NULL, FALSE); | 15251 | SetConsoleCtrlHandler(NULL, FALSE); |
15252 | # if ENABLE_FEATURE_EDITING | ||
15250 | if (line_input_state) { | 15253 | if (line_input_state) { |
15251 | line_input_state->flags &= ~IGNORE_CTRL_C; | 15254 | line_input_state->flags &= ~IGNORE_CTRL_C; |
15252 | } | 15255 | } |
15256 | # endif | ||
15253 | } | 15257 | } |
15254 | } | 15258 | } |
15255 | #else | 15259 | #else |