From: Max Kellermann Date: Sun, 13 Sep 2009 07:58:33 +0000 (+0200) Subject: screen_browser: moved range selection check to browser_get_selected() X-Git-Tag: release-0.15~19 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bc5dc7deb535e313abf9ea5ae4be5ebd8e333661;p=ncmpc.git screen_browser: moved range selection check to browser_get_selected() browser_get_selected() should not return an item when multiple items are selected (range selection). --- diff --git a/src/screen_browser.c b/src/screen_browser.c index e1b2e5f..13bad9b 100644 --- a/src/screen_browser.c +++ b/src/screen_browser.c @@ -273,6 +273,7 @@ static struct filelist_entry * browser_get_selected(const struct screen_browser *browser) { if (browser->filelist == NULL || + browser->lw->selected_start < browser->lw->selected_end || browser->lw->selected >= filelist_length(browser->filelist)) return NULL; @@ -295,7 +296,7 @@ browser_handle_enter(struct screen_browser *browser, mpdclient_t *c) struct filelist_entry *entry = browser_get_selected(browser); mpd_InfoEntity *entity; - if( entry==NULL || browser->lw->selected_start < browser->lw->selected_end) + if (entry == NULL) return false; entity = entry->entity;