vt: make mouse selection of non-ASCII consistent
For some reason a handful of ISO-8859-1 symbols are excluded from "word chars" while the vast majority of Unicode is hard-coded as included, even when inappropriate (we really would want to _not_ select line-drawing/etc). Those symbols are: ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿×÷ Thus, let's not special-case any non-ASCII anymore. Attempts to set these via ioctl will be silently ignored. As an extra bonus, we debloat the kernel by 128 bytes. Signed-off-by: Adam Borowski <kilobyte@angband.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
7d6d44aee0
Коммит
7f1534e172
|
@ -80,21 +80,17 @@ void clear_selection(void)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* User settable table: what characters are to be considered alphabetic?
|
* User settable table: what characters are to be considered alphabetic?
|
||||||
* 256 bits. Locked by the console lock.
|
* 128 bits. Locked by the console lock.
|
||||||
*/
|
*/
|
||||||
static u32 inwordLut[8]={
|
static u32 inwordLut[]={
|
||||||
0x00000000, /* control chars */
|
0x00000000, /* control chars */
|
||||||
0x03FFE000, /* digits and "-./" */
|
0x03FFE000, /* digits and "-./" */
|
||||||
0x87FFFFFE, /* uppercase and '_' */
|
0x87FFFFFE, /* uppercase and '_' */
|
||||||
0x07FFFFFE, /* lowercase */
|
0x07FFFFFE, /* lowercase */
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0xFF7FFFFF, /* latin-1 accented letters, not multiplication sign */
|
|
||||||
0xFF7FFFFF /* latin-1 accented letters, not division sign */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline int inword(const u16 c) {
|
static inline int inword(const u16 c) {
|
||||||
return c > 0xff || (( inwordLut[c>>5] >> (c & 0x1F) ) & 1);
|
return c > 0x7f || (( inwordLut[c>>5] >> (c & 0x1F) ) & 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -106,10 +102,10 @@ static inline int inword(const u16 c) {
|
||||||
*/
|
*/
|
||||||
int sel_loadlut(char __user *p)
|
int sel_loadlut(char __user *p)
|
||||||
{
|
{
|
||||||
u32 tmplut[8];
|
u32 tmplut[ARRAY_SIZE(inwordLut)];
|
||||||
if (copy_from_user(tmplut, (u32 __user *)(p+4), 32))
|
if (copy_from_user(tmplut, (u32 __user *)(p+4), sizeof(inwordLut)))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
memcpy(inwordLut, tmplut, 32);
|
memcpy(inwordLut, tmplut, sizeof(inwordLut));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче