]> Sergey Matveev's repositories - nnn.git/commitdiff
Shows 'Cannot resolve path' on narrow terminal
authorArun Prakash Jana <engineerarun@gmail.com>
Wed, 29 Mar 2017 20:42:44 +0000 (02:12 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Wed, 29 Mar 2017 20:42:44 +0000 (02:12 +0530)
noice truncates the cwd string dynamically. If the numbers of columns is lesser than the length of the path, cwd is truncated so that the correct path cannot be resolved. We should try to resolve the full path instead.

noice.c

diff --git a/noice.c b/noice.c
index 83319adedeccd81da28d563988ef878dd23223ee..96bc5a1e8165825e53814b5b1202cb8f843831f8 100644 (file)
--- a/noice.c
+++ b/noice.c
@@ -614,7 +614,7 @@ redraw(char *path)
                ncols = PATH_MAX;
        strlcpy(cwd, path, ncols);
        cwd[ncols - strlen(CWD) - 1] = '\0';
-       if (!realpath(cwd, cwdresolved)) {
+       if (!realpath(path, cwdresolved)) {
                printmsg("Cannot resolve path");
                return;
        }