aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-04-18 15:08:23 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-04-18 15:08:23 +0530
commit12df1ab083d9692d97c2bf248000cc5e94a0445d (patch)
treec5b7d7ae0ec75aebc18a8550957620b4ae6af946 /src/nnn.c
parentb40e12ee9f249a9374dd28dbe2d265371082fa46 (diff)
downloadnnn-12df1ab083d9692d97c2bf248000cc5e94a0445d.tar.gz
Fix listing files directly under /
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nnn.c b/src/nnn.c
index a49aed9..5f7b5ac 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -6301,6 +6301,10 @@ static char *make_tmp_tree(char **paths, ssize_t entries, const char *prefix)
/* Points right after the base tmp dir */
tmp += 10;
+ /* handle the case where files are directly under / */
+ if (!prefix[1] && (prefix[0] == '/'))
+ len = 0;
+
if (!mkdtemp(tmpdir)) {
free(tmpdir);