diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2020-02-09 05:38:12 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2020-02-09 05:38:12 +0530 |
commit | 43fc9890e86b32138837d3adb8dc8a4de3c818b4 (patch) | |
tree | b440d04d24b641348b3fa13ce4ad19f0a0ddd035 /src/nnn.c | |
parent | bc5234be8d76c996d323a4b3621af89740550f14 (diff) | |
download | nnn-43fc9890e86b32138837d3adb8dc8a4de3c818b4.tar.gz |
When a file is edited, vim adds a \n at the end
Diffstat (limited to 'src/nnn.c')
-rw-r--r-- | src/nnn.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -964,11 +964,11 @@ static char *common_prefix(const char *path, char *prefix) while (*x && *y && (*x == *y)) ++x, ++y; - /* Strings are same OR prefix is smaller */ + /* Strings are same OR prefix is shorter */ if ((!*x && !*y) || !*y) return prefix; - /* Path is smaller */ + /* Path is shorter */ if (!*x) { xstrlcpy(prefix, path, path - x + 1); return prefix; @@ -6219,7 +6219,7 @@ static char *load_input() DPRINTF_S(paths[0]); for (i = 0; i < entries; ++i) { - if (selforparent(paths[i])) { + if (paths[i][0] == '\n' || selforparent(paths[i])) { paths[i] = NULL; continue; } |