Create ~/.config if missing

This commit is contained in:
Arun Prakash Jana 2019-05-27 18:55:05 +05:30
parent 5ea8218e4f
commit b767d3335c
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 9 additions and 1 deletions

View File

@ -4300,10 +4300,18 @@ static bool setup_config(void)
return FALSE;
}
r = xstrlcpy(cfgdir, home, len);
xstrlcpy(cfgdir + r - 1, "/.config/nnn", len - r);
/* Create ~/.config */
xstrlcpy(cfgdir + r - 1, "/.config", len - r);
DPRINTF_S(cfgdir);
if (!create_dir(cfgdir)) {
xerror();
return FALSE;
}
/* Create ~/.config/nnn */
xstrlcpy(cfgdir + r - 1, "/.config/nnn", len - r);
DPRINTF_S(cfgdir);
if (!create_dir(cfgdir)) {
xerror();
return FALSE;