aboutsummaryrefslogtreecommitdiff
path: root/libbb/lineedit.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-09-29 00:00:12 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-09-29 00:00:12 +0200
commit2f3f09c287f43dcad50b740793c2b467f166c058 (patch)
tree060c93df91102b1dda2815060ef71a769a5ddbfe /libbb/lineedit.c
parentdb9c57eed1db2fd53bfd653efcf19210e5b14080 (diff)
downloadbusybox-w32-2f3f09c287f43dcad50b740793c2b467f166c058.tar.gz
busybox-w32-2f3f09c287f43dcad50b740793c2b467f166c058.tar.bz2
busybox-w32-2f3f09c287f43dcad50b740793c2b467f166c058.zip
libbb/lineedit: restore ^D handling for unicode
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/lineedit.c')
-rw-r--r--libbb/lineedit.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 3689b4b5d..9b112bccf 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -114,8 +114,8 @@ struct lineedit_statics {
114 unsigned cmdedit_prmt_len; /* length of prompt (without colors etc) */ 114 unsigned cmdedit_prmt_len; /* length of prompt (without colors etc) */
115 115
116 unsigned cursor; 116 unsigned cursor;
117 unsigned command_len; 117 int command_len; /* must be signed */
118 /* *int* maxsize: we want x in "if (x > S.maxsize)" 118 /* signed maxsize: we want x in "if (x > S.maxsize)"
119 * to _not_ be promoted to unsigned */ 119 * to _not_ be promoted to unsigned */
120 int maxsize; 120 int maxsize;
121 CHAR_T *command_ps; 121 CHAR_T *command_ps;
@@ -2124,7 +2124,9 @@ int FAST_FUNC read_line_input(const char *prompt, char *command, int maxsize, li
2124#undef command 2124#undef command
2125 2125
2126#if ENABLE_FEATURE_ASSUME_UNICODE 2126#if ENABLE_FEATURE_ASSUME_UNICODE
2127 command_len = save_string(command, maxsize - 1); 2127 command[0] = '\0';
2128 if (command_len > 0)
2129 command_len = save_string(command, maxsize - 1);
2128 free(command_ps); 2130 free(command_ps);
2129#endif 2131#endif
2130 2132