[kbd] U+f000 and above
Michael Schutte
michi at uiae.at
Wed Nov 12 19:04:21 MSK 2008
On Mon, Nov 10, 2008 at 05:54:52PM +0300, Alexey Gladkov wrote:
>> Do you agree with me that it would make sense to make loadkeys fail (or
>> at least warn the user) on U+xxxx keysym specifications >= 0xf000?
>
> I agree. This is a good idea.
Okay then, this does the trick:
diff --git a/src/analyze.l b/src/analyze.l
index f55c676..392c9aa 100644
--- a/src/analyze.l
+++ b/src/analyze.l
@@ -90,7 +90,7 @@ To to|To|TO
\- {return(DASH);}
\, {return(COMMA);}
\+ {return(PLUS);}
-{Unicode} {yylval=strtol(yytext+1,NULL,16);return(UNUMBER);}
+{Unicode} {yylval=strtol(yytext+1,NULL,16);if(yylval>=0xf000)lkfatal1("unicode keysym out of range: %s",yytext);return(UNUMBER);}
{Decimal}|{Octal}|{Hex} {yylval=strtol(yytext,NULL,0);return(NUMBER);}
<RVALUE>{Literal} {return((yylval=ksymtocode(yytext))==-1?ERROR:LITERAL);}
Sorry for the ugliness, I just sticked to the prevailing coding style in
analyze.l. Re-format as you wish :-)
--
Michael Schutte <michi at uiae.at>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: Digital signature
URL: <http://lists.altlinux.org/pipermail/kbd/attachments/20081112/c5325200/attachment.bin>
More information about the kbd
mailing list