From b767d3335c8a624867dcd69bf41c3e522608c0d8 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Mon, 27 May 2019 18:55:05 +0530 Subject: Create ~/.config if missing --- src/nnn.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3-70-g09d2