On Tue, Apr 06, 2010 at 09:42:13AM +0200, rolandc wrote:
> 2010/3/31 Dirk Wallenstein <[email protected]>:
> > 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

Attachment: pgpXW1GS4sYbr.pgp
Description: PGP signature

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to