aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-05-27 18:55:05 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-05-27 18:55:05 +0530
commitb767d3335c8a624867dcd69bf41c3e522608c0d8 (patch)
tree207dcf8180daf5e6cd62edb162148c6710b602c0 /src/nnn.c
parent5ea8218e4f85336f092fefe077af21673ed6beb5 (diff)
downloadnnn-b767d3335c8a624867dcd69bf41c3e522608c0d8.tar.gz
Create ~/.config if missing
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/nnn.c b/src/nnn.c
index d1b64bc..9732c0f 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -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;