From: Arun Prakash Jana Date: Wed, 22 Jan 2020 14:39:16 +0000 (+0530) Subject: Check if path exists before trying to create X-Git-Tag: v3.0~53 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=60dfb79b8d5dfa3e1b3708d2349ee58fe7645b97;p=nnn.git Check if path exists before trying to create --- diff --git a/src/nnn.c b/src/nnn.c index 1d6fbf61..ecf17e17 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; }