xorg-server: fix XKB_BINDIR usage (close #8993)

Previously, XKB_BINDIR was read inside a loop over the program
arguments, so was only read if it had arguments that weren't matched by
the first some number of checks.

authored by Max Zerzouri and committed by Vladimír Čunát 807a0e46 ec8f2716

+15 -15
+15 -15
pkgs/servers/x11/xorg/xorgserver-xkbcomp-path.patch
··· 1 - *** xorg-server-X11R7.2-1.2.0-orig/xkb/xkbInit.c 2015-02-11 00:32:06.000000000 +0100 2 - --- xorg-server-X11R7.2-1.2.0/xkb/xkbInit.c 2015-04-11 10:10:41.948438435 +0200 3 - *************** 4 - *** 733,738 **** 5 - --- 733,742 ---- 6 - int 7 - XkbProcessArguments(int argc, char *argv[], int i) 8 - { 9 - + char *xkbBinDir = getenv("XKB_BINDIR"); 10 - + if (xkbBinDir) 11 - + XkbBinDirectory = Xstrdup(xkbBinDir); 12 - + 13 - if (strncmp(argv[i], "-xkbdir", 7) == 0) { 14 - if (++i < argc) { 15 - #if !defined(WIN32) && !defined(__CYGWIN__) 1 + diff --git a/os/utils.c b/os/utils.c 2 + index ed7581e..6593455 100644 3 + --- a/os/utils.c 4 + +++ b/os/utils.c 5 + @@ -658,6 +658,10 @@ ProcessCommandLine(int argc, char *argv[]) 6 + 7 + defaultKeyboardControl.autoRepeat = TRUE; 8 + 9 + + char *xkbBinDir = getenv("XKB_BINDIR"); 10 + + if (xkbBinDir) 11 + + XkbBinDirectory = Xstrdup(xkbBinDir); 12 + + 13 + #ifdef NO_PART_NET 14 + PartialNetwork = FALSE; 15 + #else