d19bc46909b564832cb7549bcef636b1a52ba69b
[buildroot.git] /
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."
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 This reverts commit 531785dd746d64ef7f473a83ca73bb20e74b6fca.
10
11 The above commit breaks Xephyr option parsing. Andrzej writes:
12
13 Xephyr -retro -keybd evdev,,device=/dev/input/event2,xkbrules=evdev,xkbmodel=evdev,xkblayout=pl -mouse evdev,,device=/dev/input/event1 :3
14
15 results in:
16
17 <snip>
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!
23 <snip>
24
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
32 them available again.
33
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>
40 ---
41 hw/kdrive/src/kinput.c | 2 +-
42 1 file changed, 1 insertion(+), 1 deletion(-)
43
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)
49
50 if (strchr(string, '=')) {
51 tam_key = (strchr(string, '=') - string);
52 - key = strndup(string, tam_key + 1);
53 + key = strndup(string, tam_key);
54 if (!key)
55 goto out;
56
57 --
58 1.7.10.4
59