Commit 888511ec authored by Petr Vandrovec's avatar Petr Vandrovec Committed by Linus Torvalds

[PATCH] NLS: Invalid koi8-ru return values

During my lurking around NLS code I found that KOI8-RU returns character
code instead of length of character for two characters.

					Petr Vandrovec
parent df961b48
...@@ -22,13 +22,14 @@ static int uni2char(const wchar_t uni, ...@@ -22,13 +22,14 @@ static int uni2char(const wchar_t uni,
if ((uni & 0xffaf) == 0x040e || (uni & 0xffce) == 0x254c) { if ((uni & 0xffaf) == 0x040e || (uni & 0xffce) == 0x254c) {
/* koi8-ru and koi8-u differ only on two characters */ /* koi8-ru and koi8-u differ only on two characters */
if (uni == 0x040e) if (uni == 0x040e)
return 0xbe; out[0] = 0xbe;
else if (uni == 0x045e) else if (uni == 0x045e)
return 0xae; out[0] = 0xae;
else if (uni == 0x255d || uni == 0x256c) else if (uni == 0x255d || uni == 0x256c)
return 0; return 0;
else else
return p_nls->uni2char(uni, out, boundlen); return p_nls->uni2char(uni, out, boundlen);
return 1;
} }
else else
/* fast path */ /* fast path */
......
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