aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-01-22 20:09:16 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-01-22 20:09:16 +0530
commit60dfb79b8d5dfa3e1b3708d2349ee58fe7645b97 (patch)
tree4513b094e77f4279124b7809f8f0930d4c60399e /src/nnn.c
parenta87be622049622b4a9af411f7cbd552cd7860a43 (diff)
downloadnnn-60dfb79b8d5dfa3e1b3708d2349ee58fe7645b97.tar.gz
Check if path exists before trying to create
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c4
1 files 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;
}