diff --git a/xkbcomp.c b/xkbcomp.c index 51eb224124c573e9a258e5b775170dc6af5ef491..37dc8f5b4936068a64538e22184bdf676f9c7f9e 100644 --- a/xkbcomp.c +++ b/xkbcomp.c @@ -549,11 +549,14 @@ parseArgs(int argc, char *argv[]) { WARN1("Changing root directory to \"%s\"\n", rootDir); } - if ((chdir(rootDir) < 0) && (warningLevel > 0)) + if (chdir(rootDir) == 0) { - WARN1("Couldn't change directory to \"%s\"\n", rootDir); - ACTION("Root directory (-R) option ignored\n"); - rootDir = NULL; + XkbAddDirectoryToPath("."); + } else if (warningLevel > 0) + { + WARN1("Couldn't change directory to \"%s\"\n", rootDir); + ACTION("Root directory (-R) option ignored\n"); + rootDir = NULL; } } }