]> Sergey Matveev's repositories - nnn.git/commitdiff
Fix listing files directly under /
authorArun Prakash Jana <engineerarun@gmail.com>
Sat, 18 Apr 2020 09:38:23 +0000 (15:08 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sat, 18 Apr 2020 09:38:23 +0000 (15:08 +0530)
src/nnn.c

index a49aed9a946899d8a4c90ef80aafdb1a8cf7a3e9..5f7b5ac2f86b94afa4fa1c55c54c5475483b26fe 100644 (file)
--- 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);