xkbcomp -Rdir is ignored

rolandc roland.cassard at gmail.com
Tue Apr 6 00:42:13 PDT 2010


2010/3/31 Dirk Wallenstein <halsmit at t-online.de>:
> On Wed, 31 Mar 2010 10:20:23 +0200 rolandc wrote:
>> Hi,
>>
>> The "-R" command line parameter specifies the root directory for
>> relative path names (see man page)
>>
>> At the source level, the variable rootDir holds the value of the -R
>> parameter, but rootDir is never used by xkbcomp
>
> I got this in line 550 of xkbcomp.c:
>
>                if ((chdir(rootDir) < 0) && (warningLevel > 0))
>
> I needn't be global, though, except for the warning when -R is specified
> more than once.

yes, but it seems that "chdir(rootDir)" just checks the existance of this path.
After that, rootDir is never used

to take into account rootDir (the -R parameter), xkbcomp must call
XkbAddDirectoryToPath() like for example :

--- origsrc/xkbcomp-1.1.1/xkbcomp.c	2009-08-06 03:49:47.000000000 +0200
+++ src/xkbcomp-1.1.1/xkbcomp.c	2010-04-06 09:31:32.360963500 +0200
@@ -553,6 +553,12 @@ parseArgs(int argc, char *argv[])
                     ACTION("Root directory (-R) option ignored\n");
                     rootDir = NULL;
                 }
+                XkbAddDirectoryToPath(NULL);
+                if (!XkbAddDirectoryToPath(&argv[i][2]))
+                {
+                    ACTION("Exiting\n");
+                    exit(1);
+                }
             }
         }
         else if ((strcmp(argv[i], "-synch") == 0)
with :
XkbAddDirectoryToPath(NULL) to clear predefined root path
XkbAddDirectoryToPath(&argv[i][2]) to add the path of -R parameter

Is it correct ?

Regards,


More information about the xorg-devel mailing list