diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2019-06-09 11:52:36 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2019-06-09 11:52:36 -0700 |
commit | 7e74a1d3d443df68a1a4be9ccce7439462c1531a (patch) | |
tree | 66ded24e0d76d799cbbda81433d3c168f269d5c7 | |
parent | 51cd85bbec1e62d566b1c893ecc668886165a047 (diff) |
Correct error messages for missing/invalid file passed to -config
Now a non-existent file prints:
Couldn't find configuration file "not-there"
and a file that fails to parse prints:
Couldn't parse configuration file "not-right"
Fixes: #3, https://bugs.freedesktop.org/show_bug.cgi?id=101845
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | setxkbmap.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/setxkbmap.c b/setxkbmap.c index cf0f02d..3af641e 100644 --- a/setxkbmap.c +++ b/setxkbmap.c @@ -742,12 +742,15 @@ applyConfig(char *name) Bool ok; if ((fp = findFileInPath(name)) == NULL) + { + ERR1("Couldn't find configuration file \"%s\"\n", name); return False; + } ok = XkbCFParse(fp, XkbCFDflts, NULL, &cfgResult); fclose(fp); if (!ok) { - ERR1("Couldn't find configuration file \"%s\"\n", name); + ERR1("Couldn't parse configuration file \"%s\"\n", name); return False; } if (cfgResult.rules_file) |