diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2020-12-21 22:50:23 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2020-12-21 22:50:23 +0100 |
commit | 96717d9fb4560ad98a737108f83c7b247ef04674 (patch) | |
tree | 686387d7c8e45e270cb448c4254d911f427d2ddf /libbb | |
parent | fae7332ebf0f059039a8ede16a57da9646051159 (diff) | |
download | busybox-w32-96717d9fb4560ad98a737108f83c7b247ef04674.tar.gz busybox-w32-96717d9fb4560ad98a737108f83c7b247ef04674.tar.bz2 busybox-w32-96717d9fb4560ad98a737108f83c7b247ef04674.zip |
lineedit: code shrink
function old new delta
read_line_input 3171 3157 -14
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/lineedit.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 499be4972..75de88e77 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -216,9 +216,6 @@ extern struct lineedit_statics *const lineedit_ptr_to_statics; | |||
216 | #define INIT_S() do { \ | 216 | #define INIT_S() do { \ |
217 | (*(struct lineedit_statics**)not_const_pp(&lineedit_ptr_to_statics)) = xzalloc(sizeof(S)); \ | 217 | (*(struct lineedit_statics**)not_const_pp(&lineedit_ptr_to_statics)) = xzalloc(sizeof(S)); \ |
218 | barrier(); \ | 218 | barrier(); \ |
219 | cmdedit_termw = 80; \ | ||
220 | IF_USERNAME_OR_HOMEDIR(home_pwd_buf = (char*)null_str;) \ | ||
221 | IF_FEATURE_EDITING_VI(delptr = delbuf;) \ | ||
222 | } while (0) | 219 | } while (0) |
223 | 220 | ||
224 | static void deinit_S(void) | 221 | static void deinit_S(void) |
@@ -2393,6 +2390,11 @@ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *comman | |||
2393 | char read_key_buffer[KEYCODE_BUFFER_SIZE]; | 2390 | char read_key_buffer[KEYCODE_BUFFER_SIZE]; |
2394 | 2391 | ||
2395 | INIT_S(); | 2392 | INIT_S(); |
2393 | //command_len = 0; - done by INIT_S() | ||
2394 | //cmdedit_y = 0; /* quasireal y, not true if line > xt*yt */ | ||
2395 | cmdedit_termw = 80; | ||
2396 | IF_USERNAME_OR_HOMEDIR(home_pwd_buf = (char*)null_str;) | ||
2397 | IF_FEATURE_EDITING_VI(delptr = delbuf;) | ||
2396 | 2398 | ||
2397 | n = get_termios_and_make_raw(STDIN_FILENO, &new_settings, &initial_settings, 0 | 2399 | n = get_termios_and_make_raw(STDIN_FILENO, &new_settings, &initial_settings, 0 |
2398 | | TERMIOS_CLEAR_ISIG /* turn off INTR (ctrl-C), QUIT, SUSP */ | 2400 | | TERMIOS_CLEAR_ISIG /* turn off INTR (ctrl-C), QUIT, SUSP */ |
@@ -2441,8 +2443,6 @@ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *comman | |||
2441 | #endif | 2443 | #endif |
2442 | 2444 | ||
2443 | /* prepare before init handlers */ | 2445 | /* prepare before init handlers */ |
2444 | cmdedit_y = 0; /* quasireal y, not true if line > xt*yt */ | ||
2445 | command_len = 0; | ||
2446 | #if ENABLE_UNICODE_SUPPORT | 2446 | #if ENABLE_UNICODE_SUPPORT |
2447 | command_ps = xzalloc(maxsize * sizeof(command_ps[0])); | 2447 | command_ps = xzalloc(maxsize * sizeof(command_ps[0])); |
2448 | #else | 2448 | #else |