nnn.1 | 2 +- src/nnn.c | 10 ++++++---- diff --git a/nnn.1 b/nnn.1 index 1e998241880b64c5132ee0dd74550d04fd21d3ea..8fb8471eeb88429ed8dd02c297f0c946f44ae308 100644 --- a/nnn.1 +++ b/nnn.1 @@ -312,7 +312,7 @@ - search using a plugin (e.g. \fIfinder\fR) and list the results .Pp File paths must be NUL-separated ('\\0'). Paths and can be relative to the current directory or absolute. Invalid paths in the input are ignored. Input -limit is 65,536 paths or 256 MiB of data. +limit is 16,384 paths or 256 MiB of data. .Pp To list the input stream, start .Nm diff --git a/src/nnn.c b/src/nnn.c index b10143a403d06e9e4c037f83f47d54702736c0e4..d7ad6a3996b358b06553d8da0ba7864b908b4a9e 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -189,7 +189,7 @@ #define TMP_LEN_MAX 64 #define DOT_FILTER_LEN 7 #define ASCII_MAX 128 #define EXEC_ARGS_MAX 10 -#define LIST_FILES_MAX (1 << 16) +#define LIST_FILES_MAX (1 << 14) /* Support listing 16K files */ #define SCROLLOFF 3 #define COLOR_256 256 @@ -5543,7 +5543,7 @@ return TRUE; } /* Skip self and parent */ -static bool selforparent(const char *path) +static inline bool selforparent(const char *path) { return path[0] == '.' && (path[1] == '\0' || (path[1] == '.' && path[2] == '\0')); } @@ -7900,7 +7900,8 @@ slash = xmemrchr((uchar_t *)tmp, '/', xstrlen(paths[i]) - len); if (slash) *slash = '\0'; - xmktree(tmpdir, TRUE); + if (access(tmpdir, F_OK)) /* Create directory if it doesn't exist */ + xmktree(tmpdir, TRUE); if (slash) *slash = '/'; @@ -8194,7 +8195,8 @@ /* Create bookmarks, sessions, mounts and plugins directories */ for (r = 0; r < ELEMENTS(toks); ++r) { mkpath(cfgpath, toks[r], plgpath); - if (!xmktree(plgpath, TRUE)) { + /* The dirs are created on first run, check if they already exist */ + if (access(plgpath, F_OK) && !xmktree(plgpath, TRUE)) { DPRINTF_S(toks[r]); xerror(); return FALSE;