[PATCH evdev 7/8] Move mode declaration, it's not const either.

Peter Hutterer peter.hutterer at who-t.net
Sun May 23 17:57:47 PDT 2010


What we're getting back from xf86SetStrOption is a strdup'd string, not
const, especially given that we free it a few lines down.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index beded3d..7d2e138 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1139,7 +1139,6 @@ EvdevAddAbsClass(DeviceIntPtr device)
     EvdevPtr pEvdev;
     int num_axes, axis, i = 0;
     Atom *atoms;
-    const char *mode;
 
     pInfo = device->public.devicePrivate;
     pEvdev = pInfo->private;
@@ -1227,6 +1226,7 @@ EvdevAddAbsClass(DeviceIntPtr device)
 
     if (xf86FindOption(pInfo->options, "Mode"))
     {
+        char *mode;
         mode = xf86SetStrOption(pInfo->options, "Mode", NULL);
         if (!strcasecmp("absolute", mode))
             pEvdev->flags &= ~EVDEV_RELATIVE_MODE;
-- 
1.7.0.1



More information about the xorg-devel mailing list