From 84ea60ed65f6ea6fd3b2170e44bbff5de410a78b Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 2 Aug 2017 17:27:28 +0200 Subject: 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 --- editors/ed.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'editors/ed.c') 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) * 0 on ctrl-C, * >0 length of input string, including terminating '\n' */ - len = read_line_input(NULL, "", buf, sizeof(buf), /*timeout*/ -1); + len = read_line_input(NULL, "", buf, sizeof(buf)); if (len <= 0) { /* Previously, ctrl-C was exiting to shell. * Now we exit to ed prompt. Is in important? */ @@ -789,7 +789,7 @@ static void doCommands(void) * 0 on ctrl-C, * >0 length of input string, including terminating '\n' */ - len = read_line_input(NULL, ": ", buf, sizeof(buf), /*timeout*/ -1); + len = read_line_input(NULL, ": ", buf, sizeof(buf)); if (len <= 0) return; while (len && isspace(buf[--len])) @@ -892,7 +892,7 @@ static void doCommands(void) } if (!dirty) return; - len = read_line_input(NULL, "Really quit? ", buf, 16, /*timeout*/ -1); + len = read_line_input(NULL, "Really quit? ", buf, 16); /* read error/EOF - no way to continue */ if (len < 0) return; -- cgit v1.2.3