summaryrefslogtreecommitdiff
path: root/shell/msh.c
diff options
context:
space:
mode:
authorDenis Vlasenko2008-02-02 18:35:55 +0000
committerDenis Vlasenko2008-02-02 18:35:55 +0000
commit80667e30fbd3feb95a0af4bca0f512694a438bde (patch)
treeac8223bf853a4aeae269030fd4692d717dd876a5 /shell/msh.c
parenta2980c6249e476926f09a185840d893bb9a03a6e (diff)
downloadbusybox-80667e30fbd3feb95a0af4bca0f512694a438bde.zip
busybox-80667e30fbd3feb95a0af4bca0f512694a438bde.tar.gz
msh: fix Ctrl-C handling with line editing
Diffstat (limited to 'shell/msh.c')
-rw-r--r--shell/msh.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/shell/msh.c b/shell/msh.c
index 7371120..9a1be36 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;
}