1
1

in parse_verbatim_kbinput(), don't include the ability to enter a

Unicode sequence via verbatim input mode if we're not in a UTF-8 locale


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3588 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Этот коммит содержится в:
David Lawrence Ramsey 2006-05-28 16:25:15 +00:00
родитель a620e683e7
Коммит 5c7d88dc16
2 изменённых файлов: 41 добавлений и 37 удалений

Просмотреть файл

@ -315,7 +315,8 @@ CVS code -
- Simplify the if blocks wherever possible. (DLR) - Simplify the if blocks wherever possible. (DLR)
parse_verbatim_kbinput() parse_verbatim_kbinput()
- Don't include the ability to enter a Unicode sequence via - Don't include the ability to enter a Unicode sequence via
verbatim input mode if ENABLE_UTF8 isn't defined. (DLR) verbatim input mode if ENABLE_UTF8 isn't defined or we're not
in a UTF-8 locale. (DLR)
check_statusblank() check_statusblank()
- Avoid redundant updates when statusblank is 0. (DLR) - Avoid redundant updates when statusblank is 0. (DLR)
display_string() display_string()

Просмотреть файл

@ -1449,27 +1449,26 @@ int *parse_verbatim_kbinput(WINDOW *win, size_t *kbinput_len)
while ((kbinput = get_input(win, 1)) == NULL); while ((kbinput = get_input(win, 1)) == NULL);
#ifdef ENABLE_UTF8 #ifdef ENABLE_UTF8
if (using_utf8()) {
/* Check whether the first keystroke is a valid hexadecimal /* Check whether the first keystroke is a valid hexadecimal
* digit. */ * digit. */
uni = get_unicode_kbinput(*kbinput); uni = get_unicode_kbinput(*kbinput);
/* If the first keystroke isn't a valid hexadecimal digit, put back /* If the first keystroke isn't a valid hexadecimal digit, put
* the first keystroke. */ * back the first keystroke. */
if (uni != ERR) if (uni != ERR)
#endif /* ENABLE_UTF8 */
unget_input(kbinput, 1); unget_input(kbinput, 1);
#ifdef ENABLE_UTF8 /* Otherwise, read in keystrokes until we have a complete
/* Otherwise, read in keystrokes until we have a complete Unicode * Unicode sequence, and put back the corresponding Unicode
* sequence, and put back the corresponding Unicode value. */ * value. */
else { else {
char *uni_mb; char *uni_mb;
int uni_mb_len, *seq, i; int uni_mb_len, *seq, i;
if (win == edit) if (win == edit)
/* TRANSLATORS: This is displayed during the input of a /* TRANSLATORS: This is displayed during the input of a
* six-digit Unicode code. */ * six-digit hexadecimal Unicode character code. */
statusbar(_("Unicode Input")); statusbar(_("Unicode Input"));
while (uni == ERR) { while (uni == ERR) {
@ -1478,7 +1477,8 @@ int *parse_verbatim_kbinput(WINDOW *win, size_t *kbinput_len)
uni = get_unicode_kbinput(*kbinput); uni = get_unicode_kbinput(*kbinput);
} }
/* Put back the multibyte equivalent of the Unicode value. */ /* Put back the multibyte equivalent of the Unicode
* value. */
uni_mb = make_mbchar(uni, &uni_mb_len); uni_mb = make_mbchar(uni, &uni_mb_len);
seq = (int *)nmalloc(uni_mb_len * sizeof(int)); seq = (int *)nmalloc(uni_mb_len * sizeof(int));
@ -1491,7 +1491,10 @@ int *parse_verbatim_kbinput(WINDOW *win, size_t *kbinput_len)
free(seq); free(seq);
free(uni_mb); free(uni_mb);
} }
#endif /* ENABLE_UTF8 */ } else
#endif
/* Put back the first keystroke. */
unget_input(kbinput, 1);
/* Get the complete sequence, and save the characters in it as the /* Get the complete sequence, and save the characters in it as the
* result. */ * result. */