1 From 09f1e5b15b769e1122f0a8d7cae0820038992312 Mon Sep 17 00:00:00 2001
2 From: Julien Cristau <jcristau@debian.org>
3 Date: Sun, 7 Oct 2012 18:40:35 +0200
4 Subject: [PATCH] Revert "kinput: allocate enough space for null character."
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 This reverts commit 531785dd746d64ef7f473a83ca73bb20e74b6fca.
11 The above commit breaks Xephyr option parsing. Andrzej writes:
13 Xephyr -retro -keybd evdev,,device=/dev/input/event2,xkbrules=evdev,xkbmodel=evdev,xkblayout=pl -mouse evdev,,device=/dev/input/event1 :3
18 Pointer option key (device=) of value (/dev/input/event1) not assigned!
19 Kbd option key (device=) of value (/dev/input/event2) not assigned!
20 Kbd option key (xkbrules=) of value (evdev) not assigned!
21 Kbd option key (xkbmodel=) of value (evdev) not assigned!
22 Kbd option key (xkblayout=) of value (pl) not assigned!
25 The effect of the patch is that the "key=value" pairs are parsed in such
26 a way that the key is added an "equals" sign to it and we end up with
27 keys like "device=" instead of "device". This in turn has effect on
28 KdParsePointerOptions and KdParseKbdOptions: the key does not match
29 any choice presented in the "switch" statement, and so "Pointer/Kbd
30 option key (...) of value (...) not assigned!" happens, making all
31 "key=value" options inaccessible to the user. Reverting the patch makes
34 Reference: http://bugs.debian.org/689246
35 Reported-by: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>
36 Signed-off-by: Julien Cristau <jcristau@debian.org>
37 Cc: Dave Airlie <airlied@redhat.com>
38 Reviewed-by: Søren Sandmann <ssp@redhat.com>
39 Signed-off-by: Keith Packard <keithp@keithp.com>
41 hw/kdrive/src/kinput.c | 2 +-
42 1 file changed, 1 insertion(+), 1 deletion(-)
44 diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
45 index d35dcf8..b1068bb 100644
46 --- a/hw/kdrive/src/kinput.c
47 +++ b/hw/kdrive/src/kinput.c
48 @@ -1034,7 +1034,7 @@ KdGetOptions(InputOption **options, char *string)
50 if (strchr(string, '=')) {
51 tam_key = (strchr(string, '=') - string);
52 - key = strndup(string, tam_key + 1);
53 + key = strndup(string, tam_key);