diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-02 17:27:28 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-02 17:27:28 +0200 |
commit | 84ea60ed65f6ea6fd3b2170e44bbff5de410a78b (patch) | |
tree | 54837341ed6ed021d9b20400b8a8a5aea7bd3b62 /editors | |
parent | dd4b446f76736c0a13a61a38d7d816b6e6b5fca2 (diff) | |
download | busybox-w32-84ea60ed65f6ea6fd3b2170e44bbff5de410a78b.tar.gz busybox-w32-84ea60ed65f6ea6fd3b2170e44bbff5de410a78b.tar.bz2 busybox-w32-84ea60ed65f6ea6fd3b2170e44bbff5de410a78b.zip |
line editing: make read_line_input() not take timeout param
It's almost always -1.
function old new delta
read_line_input 3902 3912 +10
new_line_input_t 24 31 +7
pgetc 583 585 +2
save_command_ps_at_cur_history 80 78 -2
read_line 76 74 -2
fgetc_interactive 246 244 -2
addLines 84 82 -2
doCommands 2226 2222 -4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/5 up/down: 19/-12) Total: 7 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'editors')
-rw-r--r-- | editors/ed.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/editors/ed.c b/editors/ed.c index 7f21ded92..05797692c 100644 --- a/editors/ed.c +++ b/editors/ed.c | |||
@@ -360,7 +360,7 @@ static void addLines(int num) | |||
360 | * 0 on ctrl-C, | 360 | * 0 on ctrl-C, |
361 | * >0 length of input string, including terminating '\n' | 361 | * >0 length of input string, including terminating '\n' |
362 | */ | 362 | */ |
363 | len = read_line_input(NULL, "", buf, sizeof(buf), /*timeout*/ -1); | 363 | len = read_line_input(NULL, "", buf, sizeof(buf)); |
364 | if (len <= 0) { | 364 | if (len <= 0) { |
365 | /* Previously, ctrl-C was exiting to shell. | 365 | /* Previously, ctrl-C was exiting to shell. |
366 | * Now we exit to ed prompt. Is in important? */ | 366 | * Now we exit to ed prompt. Is in important? */ |
@@ -789,7 +789,7 @@ static void doCommands(void) | |||
789 | * 0 on ctrl-C, | 789 | * 0 on ctrl-C, |
790 | * >0 length of input string, including terminating '\n' | 790 | * >0 length of input string, including terminating '\n' |
791 | */ | 791 | */ |
792 | len = read_line_input(NULL, ": ", buf, sizeof(buf), /*timeout*/ -1); | 792 | len = read_line_input(NULL, ": ", buf, sizeof(buf)); |
793 | if (len <= 0) | 793 | if (len <= 0) |
794 | return; | 794 | return; |
795 | while (len && isspace(buf[--len])) | 795 | while (len && isspace(buf[--len])) |
@@ -892,7 +892,7 @@ static void doCommands(void) | |||
892 | } | 892 | } |
893 | if (!dirty) | 893 | if (!dirty) |
894 | return; | 894 | return; |
895 | len = read_line_input(NULL, "Really quit? ", buf, 16, /*timeout*/ -1); | 895 | len = read_line_input(NULL, "Really quit? ", buf, 16); |
896 | /* read error/EOF - no way to continue */ | 896 | /* read error/EOF - no way to continue */ |
897 | if (len < 0) | 897 | if (len < 0) |
898 | return; | 898 | return; |