Bug in file.open action

Hi all,

file.open will not open parent directory (../) if this directory is root
(/).
Steps to reproduce:
1. set "Show parent directory entry '..' in file lists"
2. make sure that in key bindings 'Return' is 'file.open' (I think this
is default)
3. navigate to /home/user directory
4. press return on parent dir -> it will open /home
5. press return on parent dir again -> it will still open /home

Action file.open threats parent dir entry special, it strips ending
slash and than searches for right-most but not first slash, and replaces
it by zero.
In case of /home/user/folder or /home/user it will return /home/user or
/home
But in case of /home it will return /home, because there is no
right-most slash :)

I added one more condition, that checks if slash found and is first
slash - it will zero position next after slash. So file.open will
correctly use / as parent path.
Patch attached.

Best regards,
Dmitry Zamaruev.
diff -Naur emelfm2-0.3.6.orig/src/e2_task.c emelfm2-0.3.6/src/e2_task.c
--- emelfm2-0.3.6.orig/src/e2_task.c    2007-11-28 23:56:36.000000000 +0200
+++ emelfm2-0.3.6/src/e2_task.c 2008-02-16 14:41:40.000000000 +0200
@@ -3019,6 +3019,8 @@
                                gchar *s = strrchr ((gchar *)art->data, 
G_DIR_SEPARATOR);
                                if (s != NULL && s > (gchar *)art->data)
                                        *s = '\0';
+                               if (s != NULL && s == (gchar *)art->data)
+                                       *(s+1) = '\0';
                        }
                }
        }

Other related posts: