summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Osterlund <petero2@telia.com>2003-07-20 12:42:22 +0200
committerPeter Osterlund <petero2@telia.com>2006-04-09 04:01:04 +0200
commit80bda91ccd1e08636d4588023e9fe6a1ffbfa037 (patch)
treee4c83a89b43e993bab3fc53762371177c2a54518
parentb5ae101d5d94d964c680e15c289220f208393df2 (diff)
Fixed change b5ae101d5d94d964c680e15c289220f208393df2 so that the
autodetection works also when X>=10 in eventX. (Pointed out by Hartwig Felger.)
-rw-r--r--synaptics.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/synaptics.c b/synaptics.c
index 6e507b3..93be368 100644
--- a/synaptics.c
+++ b/synaptics.c
@@ -245,7 +245,10 @@ SetDeviceAndProtocol(LocalDevicePtr local)
event_device=NULL;
s=strstr(line+sizeof(INP_DEV_H)-1, "event"); /* there might also be some other devices f.e. js0... */
if(s != NULL) {
- s[sizeof("event")]='\0'; /* terminate the string after event2 */
+ char *p = s + sizeof("event");
+ while (*p && (*p >= '0') && (*p <= '9'))
+ p++;
+ *p = 0; /* terminate the string after event2 */
event_device = malloc(strlen(s) + sizeof(DEV_INPUT_EVENT) + 1);
}
if(s == NULL || event_device == NULL) {