Skip to content

Commit

Permalink
Create ~/.config if missing
Browse files Browse the repository at this point in the history
  • Loading branch information
jarun committed May 27, 2019
1 parent 5ea8218 commit b767d33
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/nnn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b767d33

Please sign in to comment.