Commit dcaa947c authored by Peter Hutterer's avatar Peter Hutterer

For -R and after chdir, add the current directory to the path

This restores the behavior pre 1aecdffa, at
least when -R is given. For a normal invocation without -R we don't add the
current directory, because 1aecdffa isn't totally wrong about whether that's a
good idea.

Fixes #3
parent d373c9b4
......@@ -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;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment