xkbcomp -Rdir is ignored

Daniel Stone daniel at fooishbar.org
Tue Apr 6 02:37:12 PDT 2010


On Tue, Apr 06, 2010 at 09:42:13AM +0200, rolandc wrote:
> 2010/3/31 Dirk Wallenstein <halsmit at t-online.de>:
> > On Wed, 31 Mar 2010 10:20:23 +0200 rolandc wrote:
> >> 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 ?

For better or worse, . is already first in the include path (try
creating a directory called 'rules' in your current directory and
observe the ensuing fun), so the chdir works as intended.

Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100406/69521ff4/attachment.pgp>


More information about the xorg-devel mailing list