summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorGlenn L McGrath2004-01-22 12:42:23 +0000
committerGlenn L McGrath2004-01-22 12:42:23 +0000
commit475820c9de166bd8bcb7b3c3acabdba0204a2360 (patch)
tree5e2791c0e05981315023c869de4931cb34c761a9 /shell
parent8d441783817d909b7ba3c0148d7deb121e9791c8 (diff)
downloadbusybox-475820c9de166bd8bcb7b3c3acabdba0204a2360.zip
busybox-475820c9de166bd8bcb7b3c3acabdba0204a2360.tar.gz
last_patch_124 from Vodz, fix an ash bug when alt-1 was pressed, debian
bug #228915
Diffstat (limited to 'shell')
-rw-r--r--shell/cmdedit.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/shell/cmdedit.c b/shell/cmdedit.c
index ec861df..f54d5d5 100644
--- a/shell/cmdedit.c
+++ b/shell/cmdedit.c
@@ -45,6 +45,7 @@
#include "../shell/cmdedit.h"
+
#ifdef CONFIG_LOCALE_SUPPORT
#define Isprint(c) isprint((c))
#else
@@ -80,11 +81,7 @@
#endif
#ifdef CONFIG_FEATURE_GETUSERNAME_AND_HOMEDIR
-# ifndef TEST
-# include "pwd_.h"
-# else
-# include <pwd.h>
-# endif /* TEST */
+#include "pwd_.h"
#endif /* advanced FEATURES */
@@ -1377,6 +1374,14 @@ prepare_to_die:
if (safe_read(0, &c, 1) < 1)
goto prepare_to_die;
}
+ if (c >= '1' && c <= '9') {
+ unsigned char dummy;
+
+ if (safe_read(0, &dummy, 1) < 1)
+ goto prepare_to_die;
+ if(dummy != '~')
+ c = 0;
+ }
switch (c) {
#ifdef CONFIG_FEATURE_COMMAND_TAB_COMPLETION
case '\t': /* Alt-Tab */
@@ -1429,15 +1434,9 @@ rewrite_line:
input_end();
break;
default:
- if (!(c >= '1' && c <= '9'))
- c = 0;
+ c = 0;
beep();
}
- if (c >= '1' && c <= '9')
- do
- if (safe_read(0, &c, 1) < 1)
- goto prepare_to_die;
- while (c != '~');
break;
}