From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 Date: Mon, 1 Mar 2021 15:09:39 +0100 From: Alexey Gladkov To: Anisse Astier Message-ID: <20210301140939.e2lby2uau4nm3apv@example.org> References: <20210227143611.94982-1-anisse@astier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210227143611.94982-1-anisse@astier.eu> Cc: kbd@lists.altlinux.org Subject: Re: [kbd] [PATCH] src/libkeymap: add support for parsing more unicode values X-BeenThere: kbd@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Linux console tools development discussion List-Id: Linux console tools development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 14:10:05 -0000 Archived-At: List-Archive: On Sat, Feb 27, 2021 at 03:36:11PM +0100, Anisse Astier wrote: > The auto-generated (with ckbcomp) file fr-bepo_afnor did not load (even > partially), because of an U+1f12f (copyleft symbol) that is wrongly > parsed, generating this error message: > > too many (160) entries on one line > > Fix libkeymap so that the keymap can be parsed, even if the offending > character won't be loaded because of the ushort limitation of the > kb_value KDSKBENT uapi. > > It's better to have the keymap partially loaded than not at all. Nop. Partially keymap loading is very dangerous. You can get a completely unusable console. The libkeymap shouldn't break the console if it is known in advance that the keymap is not correct. You should fix ckbcomp so that it generates the correct keymap. > Signed-off-by: Anisse Astier > Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=968195 > --- > src/libkeymap/analyze.l | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/libkeymap/analyze.l b/src/libkeymap/analyze.l > index 9e76eae..4bdffb4 100644 > --- a/src/libkeymap/analyze.l > +++ b/src/libkeymap/analyze.l > @@ -319,7 +319,7 @@ Include include[ \t]* > Decimal [1-9][0-9]* > Octal 0[0-7]* > Hex 0[xX][0-9a-fA-F]+ > -Unicode U\+([0-9a-fA-F]){4} > +Unicode U\+([0-9a-fA-F]){4,6} > Literal [a-zA-Z][a-zA-Z_0-9]* > Octa ([0-7]){1,3} > Charset charset|Charset|CharSet|CHARSET > @@ -404,7 +404,7 @@ To to|To|TO > if (parse_int(yyextra, yytext, yytext + 1, 16, &(yylval->num)) < 0) > return(ERROR); > > - if (yylval->num >= 0xf000) { > + if (yylval->num >= 0x10ffff) { > ERR(yyextra, _("unicode keysym out of range: %s"), > yytext); > return(ERROR); > -- > 2.29.2 > -- Rgrds, legion