$NetBSD: patch-ab,v 1.2 2003/05/18 21:09:08 abs Exp $ --- src/rcfile.y.orig Wed May 22 00:06:25 2002 +++ src/rcfile.y @@ -304,12 +304,16 @@ options_stmt : error keys_stmt : error | KEYNAME STRING modmask keyarg { - if (keys_add(XKeysymToKeycode(display, XStringToKeysym($2)), - $3, $1, (void *) $4) == NULL) { - free($2); - yyerror("couldn't allocate memory for keybind_t"); - YYERROR; - } + int keycode; + keycode = XKeysymToKeycode(display, XStringToKeysym($2)); + if (keycode == 0 && strncmp($2, "KeyCode", 7) == 0) + keycode = atoi($2 + 7); + if (keycode > 0) + if (keys_add(keycode, $3, $1, (void *) $4) == NULL) { + free($2); + yyerror("couldn't allocate memory for keybind_t"); + YYERROR; + } free($2); } ; @@ -536,7 +540,7 @@ void rcfile_parse() { */ fp = fopen(rcfn, "r"); if (!fp) { - snprintf(filedir, MAXPATHLEN, "%s/golem/", DATADIR); + snprintf(filedir, MAXPATHLEN, "%s/", PKG_SYSCONFDIR); snprintf(rcfn, sizeof(rcfn), "%s%s", filedir, filename); fp = fopen(rcfn, "r"); if (!fp)