From 80667e30fbd3feb95a0af4bca0f512694a438bde Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sat, 2 Feb 2008 18:35:55 +0000 Subject: msh: fix Ctrl-C handling with line editing --- shell/msh.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'shell/msh.c') diff --git a/shell/msh.c b/shell/msh.c index 7371120ca..9a1be36d9 100644 --- a/shell/msh.c +++ b/shell/msh.c @@ -4836,7 +4836,9 @@ static int filechar(struct ioarg *ap) static int position = 0, size = 0; while (size == 0 || position >= size) { - read_line_input(current_prompt, filechar_cmdbuf, BUFSIZ, line_input_state); + /* Repeat if Ctrl-C is pressed. TODO: exit on -1 (error/EOF)? */ + while (read_line_input(current_prompt, filechar_cmdbuf, BUFSIZ, line_input_state) == 0) + continue; size = strlen(filechar_cmdbuf); position = 0; } -- cgit v1.2.3