From 60dfb79b8d5dfa3e1b3708d2349ee58fe7645b97 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Wed, 22 Jan 2020 20:09:16 +0530 Subject: Check if path exists before trying to create --- src/nnn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nnn.c b/src/nnn.c index 1d6fbf6..ecf17e1 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -5796,7 +5796,7 @@ static bool setup_config(void) xstrlcpy(plugindir, cfgdir, len); DPRINTF_S(plugindir); - if (!xmktree(plugindir, TRUE)) { + if (access(plugindir, F_OK) && !xmktree(plugindir, TRUE)) { xerror(); return FALSE; } @@ -5808,7 +5808,7 @@ static bool setup_config(void) xstrlcpy(sessiondir, cfgdir, len); DPRINTF_S(sessiondir); - if (!xmktree(sessiondir, TRUE)) { + if (access(sessiondir, F_OK) && !xmktree(sessiondir, TRUE)) { xerror(); return FALSE; } -- cgit v1.2.3-70-g09d2