[xorg-x11-xkb-utils/f14/master] xkbcomp-hex-parsing.patch: fix up parsing of hex-code symbols (#638244)

Peter Hutterer whot at fedoraproject.org
Mon Oct 11 01:59:38 UTC 2010


commit 4ad97636df3afaf693164496f893a20c2f28b59c
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Oct 11 12:00:05 2010 +1000

    xkbcomp-hex-parsing.patch: fix up parsing of hex-code symbols (#638244)

 xkbcomp-hex-parsing.patch |   67 +++++++++++++++++++++++++++++++++++++++++++++
 xorg-x11-xkb-utils.spec   |   10 ++++++-
 2 files changed, 76 insertions(+), 1 deletions(-)
---
diff --git a/xkbcomp-hex-parsing.patch b/xkbcomp-hex-parsing.patch
new file mode 100644
index 0000000..cc37652
--- /dev/null
+++ b/xkbcomp-hex-parsing.patch
@@ -0,0 +1,67 @@
+From a281386fa887e6bf4110840779aed46dd0ac89b6 Mon Sep 17 00:00:00 2001
+From: Daniel Stone <daniel at fooishbar.org>
+Date: Fri, 9 Jul 2010 19:34:29 +0100
+Subject: [PATCH] Fix parsing of 0x1a2b3c4d-style symbols
+
+Raw keysyms were not getting parsed correctly, due to forgetting to add
+the code to libX11, forgetting to add the backwards-compat code for old
+libX11s, and then stuffing the lexing up anyway.  Yeesh.
+
+Signed-off-by: Daniel Stone <daniel at fooishbar.org>
+---
+ configure.ac |    1 +
+ parseutils.c |   12 ++++++++++++
+ xkbparse.y   |    2 +-
+ 3 files changed, 14 insertions(+), 1 deletions(-)
+
+diff --git a/parseutils.c b/parseutils.c
+index d59e3fb..3242965 100644
+--- a/parseutils.c
++++ b/parseutils.c
+@@ -30,6 +30,8 @@
+ #include <X11/keysym.h>
+ #include <X11/extensions/XKBgeom.h>
+ #include <X11/Xalloca.h>
++#include <limits.h>
++#include <stdlib.h>
+ 
+ XkbFile *rtrnValue;
+ 
+@@ -623,6 +627,7 @@ int
+ LookupKeysym(char *str, KeySym * sym_rtrn)
+ {
+     KeySym sym;
++    char *tmp;
+ 
+     if ((!str) || (uStrCaseCmp(str, "any") == 0)
+         || (uStrCaseCmp(str, "nosymbol") == 0))
+@@ -642,6 +647,13 @@ LookupKeysym(char *str, KeySym * sym_rtrn)
+         *sym_rtrn = sym;
+         return 1;
+     }
++    if (strlen(str) > 2 && str[0] == '0' && str[1] == 'x') {
++        sym = strtoul(str, &tmp, 16);
++        if (sym != ULONG_MAX && (!tmp || *tmp == '\0')) {
++            *sym_rtrn = sym;
++            return 1;
++        }
++    }
+     return 0;
+ }
+ 
+diff --git a/xkbparse.y b/xkbparse.y
+index 862acd8..d73b92a 100644
+--- a/xkbparse.y
++++ b/xkbparse.y
+@@ -726,7 +726,7 @@ KeySym		:	IDENT           { $$= strdup(scanBuf); }
+ 		|	Integer		
+ 			{
+ 			    if ($1<10)	{ $$= malloc(2); $$[0]= '0' + $1; $$[1]= '\0'; }
+-			    else	{ $$= malloc(17); snprintf($$, 17, "%x", $1); }
++			    else	{ $$= malloc(19); snprintf($$, 19, "0x%x", $1); }
+ 			}
+ 		;
+ 
+-- 
+1.7.2.3
+
diff --git a/xorg-x11-xkb-utils.spec b/xorg-x11-xkb-utils.spec
index 22fd298..c7678ba 100644
--- a/xorg-x11-xkb-utils.spec
+++ b/xorg-x11-xkb-utils.spec
@@ -1,7 +1,7 @@
 Summary: X.Org X11 xkb utilities
 Name: xorg-x11-xkb-utils
 Version: 7.4
-Release: 8%{?dist}
+Release: 9%{?dist}
 License: MIT
 Group: User Interface/X
 URL: http://www.x.org
@@ -16,6 +16,10 @@ Source3: ftp://ftp.x.org/pub/individual/app/xkbprint-1.0.1.tar.bz2
 Source4: ftp://ftp.x.org/pub/individual/app/setxkbmap-1.1.0.tar.bz2
 
 Patch0: xkbcomp-speed.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=638244
+# Key's defined using unicode hex codes has stopped working in some/all
+# layouts (e.g. ir and af layouts)
+Patch1: xkbcomp-hex-parsing.patch
 
 BuildRequires: pkgconfig
 BuildRequires: byacc
@@ -53,6 +57,7 @@ X.Org X11 xkb gadgets
 %setup -q -c %{name}-%{version} -a1 -a2 -a3 -a4
 pushd xkbcomp-*
 %patch0 -p1 -b .speeeeeed
+%patch1 -p1 -b .hex-parsing
 popd
 
 %build
@@ -99,6 +104,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man1/xkbwatch.*
 
 %changelog
+* Mon Oct 11 2010 Peter Hutterer <peter.hutterer at redhat.com> 7.4-9
+- xkbcomp-hex-parsing.patch: fix up parsing of hex-code symbols (#638244)
+
 * Thu Jul 08 2010 Adam Jackson <ajax at redhat.com> 7.4-8
 - xkbcomp-speed.patch: Backport performance changes from git master.
 


More information about the scm-commits mailing list