diff options
Diffstat (limited to 'src/fm.c')
| -rw-r--r-- | src/fm.c | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -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); |
