diff -ruN -x Makefile -x configure -x config.cache -x config.h -x *.[178] -x gpm.info -x gpmdoc.ps -x gpmdoc.txt -x gpm-root.c -x stamp-h* -x *.elc -x *.d gpm-1.19.6.orig/src/gpn.c gpm-1.19.6/src/gpn.c
--- gpm-1.19.6.orig/src/gpn.c	Wed Jan  9 16:54:18 2002
+++ gpm-1.19.6/src/gpn.c	Wed Jan  9 16:53:57 2002
@@ -298,16 +298,8 @@
 cmdline(int argc, char **argv)
 {
   char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pr:FR::s:S:t:TveV::23";
-  int i, opt;
-  static struct {char *in; char *out;} seq[] = {
-    {"123","01234567"},
-    {"132","02134657"},
-    {"213","01452367"}, /* warning: these must be readable as integers... */
-    {"231","02461357"},
-    {"312","04152637"},
-    {"321","04261537"},
-    {NULL,NULL}
-  };
+  int i, j, opt;
+  char *p;
 
   /* initialize for the dual mouse */
   mouse_table[2]=mouse_table[1]=mouse_table[0]; /* copy defaults */
@@ -424,18 +416,23 @@
 
       if (opt_accel<1) exit(usage("acceleration"));
       if (opt_delta<2) exit(usage("delta"));
-      if (strlen(opt_sequence)!=3 || atoi(opt_sequence)<100)
+      if (strlen(opt_sequence) <= 0)
         exit(usage("sequence"));
-      if (opt_glidepoint_tap>3)
+      /* choose the sequence */
+      for (j = 0; j < 9; j++)
+	opt_buts[j] = 1 << j;
+
+      for (p = opt_sequence, j = 0; *p != '\0'; p++, j++) {
+	if ((*p < '0') || (*p > '9')) {
+	  exit(usage("button sequence"));
+	}
+	opt_buts[j] = (1 << (*p - '1'));
+      }
+
+      if (opt_glidepoint_tap>9)
         exit(usage("glidepoint tap button"));
       if (opt_glidepoint_tap)
-        opt_glidepoint_tap=GPM_B_LEFT >> (opt_glidepoint_tap-1);
-
-      /* choose the sequence */
-      for (opt=0; seq[opt].in && strcmp(seq[opt].in,opt_sequence); opt++)
-        ;
-      if (!seq[opt].in) exit(usage("button sequence"));
-      opt_sequence=strdup(seq[opt].out); /* I can rewrite on it */
+	opt_glidepoint_tap = opt_buts[opt_glidepoint_tap - 1];
 
       /* look for the mouse type */
       m_type = find_mouse_by_name(opt_type);
