diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-07-11 23:36:13 +0400 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-07-11 23:36:13 +0400 |
commit | 42a8fd0db08ab8b45fec6eab4af841f99576b260 (patch) | |
tree | 55f0600298da0c83c638c985d0c8b6d803be926b /libbb/lineedit.c | |
parent | 883cea47518a171ab83f8e41def3aec92207519e (diff) |
added simplified Unicode support for non-locale-enabled builds
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/lineedit.c')
-rw-r--r-- | libbb/lineedit.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index e5d0c1b6c..ab3297220 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c @@ -34,10 +34,7 @@ * PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] ' */ #include "libbb.h" -#if ENABLE_FEATURE_ASSUME_UNICODE -# include <wchar.h> -# include <wctype.h> -#endif +#include "unicode.h" /* FIXME: obsolete CONFIG item? */ #define ENABLE_FEATURE_NONPRINTABLE_INVERSE_PUT 0 @@ -1581,7 +1578,7 @@ static int lineedit_read_key(char *read_key_buffer) return ic; unicode_buf[unicode_idx++] = ic; unicode_buf[unicode_idx] = '\0'; - if (mbstowcs(&wc, unicode_buf, 1) < 1 && unicode_idx < MB_CUR_MAX) { + if (mbstowcs(&wc, unicode_buf, 1) != 1 && unicode_idx < MB_CUR_MAX) { delay = 50; goto poll_again; } @@ -1636,6 +1633,8 @@ int FAST_FUNC read_line_input(const char *prompt, char *command, int maxsize, li return len; } + check_unicode_in_env(); + // FIXME: audit & improve this if (maxsize > MAX_LINELEN) maxsize = MAX_LINELEN; |