Check for xdgInitHandle() failures (#2146)
Before this, running "env -i ./awesome" resulted in a segfault. This was because xdgInitHandle() failed and the following xdgSearchableConfigDirectories() followed a NULL pointer. After this commit, awesome fails with an error message. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
5c6e25fe0a
commit
c9bd787fd6
|
@ -585,7 +585,8 @@ main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get XDG basedir data */
|
/* Get XDG basedir data */
|
||||||
xdgInitHandle(&xdg);
|
if(!xdgInitHandle(&xdg))
|
||||||
|
fatal("Function xdgInitHandle() failed, is $HOME unset?");
|
||||||
|
|
||||||
/* add XDG_CONFIG_DIR as include path */
|
/* add XDG_CONFIG_DIR as include path */
|
||||||
const char * const *xdgconfigdirs = xdgSearchableConfigDirectories(&xdg);
|
const char * const *xdgconfigdirs = xdgSearchableConfigDirectories(&xdg);
|
||||||
|
|
Loading…
Reference in New Issue