]> Sergey Matveev's repositories - nnn.git/commitdiff
Don't attempt to go back if on the relative root
authorlostd <lostd@2f30.org>
Thu, 23 Oct 2014 14:39:39 +0000 (17:39 +0300)
committerlostd <lostd@2f30.org>
Thu, 23 Oct 2014 14:39:39 +0000 (17:39 +0300)
noice.c

diff --git a/noice.c b/noice.c
index a44388e4bf29ec2aeb83cac51de6a683e9b7d954..c3d3728f0fcdaf34b5d3007ff24845fd23bb6c68 100644 (file)
--- a/noice.c
+++ b/noice.c
@@ -658,7 +658,9 @@ nochange:
                        return;
                case SEL_BACK:
                        /* There is no going back */
-                       if (strcmp(path, "/") == 0)
+                       if (strcmp(path, "/") == 0 ||
+                           strcmp(path, ".") == 0 ||
+                           strchr(path, '/') == NULL)
                                goto nochange;
                        if (canopendir(path) == 0) {
                                printwarn();