Commit 56e36ef7 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

in get_word_kbinput(), limit the input word to hexadecimal FFFD instead

of FFFF, as FFFE and FFFF are invalid Unicode characters


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2967 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent bf0e47dc
Showing with 5 additions and 2 deletions
+5 -2
...@@ -260,6 +260,9 @@ CVS code - ...@@ -260,6 +260,9 @@ CVS code -
the number of lines and characters in the file or selection, the number of lines and characters in the file or selection,
as wc does. (DLR) as wc does. (DLR)
- winio.c: - winio.c:
get_word_kbinput()
- Limit the input word to hexadecimal FFFD instead of FFFF, as
FFFE and FFFF are invalid Unicode characters. (DLR)
display_string() display_string()
- Instead of using parse_mbchar()'s bad_chr parameter, use - Instead of using parse_mbchar()'s bad_chr parameter, use
mbrep() to get the representation of a bad character. (DLR) mbrep() to get the representation of a bad character. (DLR)
......
...@@ -1232,7 +1232,7 @@ int get_byte_kbinput(int kbinput ...@@ -1232,7 +1232,7 @@ int get_byte_kbinput(int kbinput
} }
/* Translate a word sequence: turn a four-digit hexadecimal number from /* Translate a word sequence: turn a four-digit hexadecimal number from
* 0000 to ffff (case-insensitive) into its corresponding word value. */ * 0000 to fffd (case-insensitive) into its corresponding word value. */
int get_word_kbinput(int kbinput int get_word_kbinput(int kbinput
#ifndef NANO_SMALL #ifndef NANO_SMALL
, bool reset , bool reset
...@@ -1303,7 +1303,7 @@ int get_word_kbinput(int kbinput ...@@ -1303,7 +1303,7 @@ int get_word_kbinput(int kbinput
word += (kbinput - '0'); word += (kbinput - '0');
retval = word; retval = word;
} else if ('a' <= tolower(kbinput) && } else if ('a' <= tolower(kbinput) &&
tolower(kbinput) <= 'f') { tolower(kbinput) <= 'd') {
word += (tolower(kbinput) + 10 - 'a'); word += (tolower(kbinput) + 10 - 'a');
retval = word; retval = word;
} else } else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment