From 44f64cf3d3fb8a5cc8589640b7ca0054250c7e53 Mon Sep 17 00:00:00 2001
From: Yorhel <git@yorhel.nl>
Date: Sun, 19 Apr 2009 13:02:02 +0200
Subject: [PATCH] Go the correct directory after a deletion

---
 src/delete.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/delete.c b/src/delete.c
index cfdd086..0cf6fcc 100644
--- a/src/delete.c
+++ b/src/delete.c
@@ -229,13 +229,15 @@ int delete_dir(struct dir *dr) {
 
 
 void delete_process() {
-  struct dir *n = root->parent;
+  struct dir *n;
   /* confirm */
   seloption = 1;
   while(state == DS_CONFIRM && !noconfirm)
     if(input_handle(0))
       return browse_init(root);
 
+  n = root->parent->sub != root ? root->parent->sub : root->next ? root->next : root->parent;
+
   /* delete */
   lastupdate = 999;
   seloption = 0;
-- 
GitLab