aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fm.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/fm.c b/src/fm.c
index db4aed8..a112e13 100644
--- a/src/fm.c
+++ b/src/fm.c
@@ -371,12 +371,13 @@ fm_cd_up(fm_info *info)
file_list *new_list = fm_getdir(info->cur, info->cwd);
if (new_list) {
info->cur = new_list;
+ info->cursor = 0;
+ info->top = 0;
+ info->bottom = info->windows[FM_PANE_LEFT]->height;
+ need_redraw = true;
+ } else {
+ return;
}
-
- info->cursor = 0;
- info->top = 0;
- info->bottom = info->windows[FM_PANE_LEFT]->height;
- need_redraw = true;
}
void
@@ -410,11 +411,13 @@ fm_cd_down(fm_info *info)
file_list *new_list = fm_getdir(info->cur, info->cwd);
if (new_list) {
info->cur = new_list;
+ info->cursor = 0;
+ info->top = 0;
+ need_redraw = true;
+ } else {
+ free(next_dir);
+ return;
}
-
- info->cursor = 0;
- info->top = 0;
- need_redraw = true;
}
free(next_dir);