libbb/lineedit: restore ^D handling for unicode
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
db9c57eed1
commit
2f3f09c287
@ -114,8 +114,8 @@ struct lineedit_statics {
|
|||||||
unsigned cmdedit_prmt_len; /* length of prompt (without colors etc) */
|
unsigned cmdedit_prmt_len; /* length of prompt (without colors etc) */
|
||||||
|
|
||||||
unsigned cursor;
|
unsigned cursor;
|
||||||
unsigned command_len;
|
int command_len; /* must be signed */
|
||||||
/* *int* maxsize: we want x in "if (x > S.maxsize)"
|
/* signed maxsize: we want x in "if (x > S.maxsize)"
|
||||||
* to _not_ be promoted to unsigned */
|
* to _not_ be promoted to unsigned */
|
||||||
int maxsize;
|
int maxsize;
|
||||||
CHAR_T *command_ps;
|
CHAR_T *command_ps;
|
||||||
@ -2124,6 +2124,8 @@ int FAST_FUNC read_line_input(const char *prompt, char *command, int maxsize, li
|
|||||||
#undef command
|
#undef command
|
||||||
|
|
||||||
#if ENABLE_FEATURE_ASSUME_UNICODE
|
#if ENABLE_FEATURE_ASSUME_UNICODE
|
||||||
|
command[0] = '\0';
|
||||||
|
if (command_len > 0)
|
||||||
command_len = save_string(command, maxsize - 1);
|
command_len = save_string(command, maxsize - 1);
|
||||||
free(command_ps);
|
free(command_ps);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user