From 222ee44bfe54e0c6719e0c0afd553cb3946f2f08 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Wed, 11 Apr 2012 21:38:07 +0400 Subject: [PATCH] Ticket #2776: file selection reset after exit from the archive in the root. After exit from archive located in the root of FS, file selection is reset (/bin is selected instead of the archive). Signed-off-by: Andrew Borodin --- src/filemanager/panel.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/filemanager/panel.c b/src/filemanager/panel.c index 74df95a89..56df44caf 100644 --- a/src/filemanager/panel.c +++ b/src/filemanager/panel.c @@ -2704,10 +2704,15 @@ get_parent_dir_name (const char *cwd, const char *lwd) return NULL; } - while (--p > lwd && *p != PATH_SEP); - while (--p > lwd && *p != PATH_SEP); - - return (p != lwd) ? p + 1 : NULL; + /* skip VFS prefix */ + while (--p > lwd && *p != PATH_SEP) + ; + /* get last component */ + while (--p > lwd && *p != PATH_SEP) + ; + + /* return last component */ + return (*p == PATH_SEP) ? p + 1 : p; } /* --------------------------------------------------------------------------------------------- */ -- 2.11.4.GIT