summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 00b15ac)
raw | patch | inline | side by side (parent: 00b15ac)
author | Max Kellermann <max@duempel.org> | |
Thu, 27 Nov 2008 15:58:14 +0000 (16:58 +0100) | ||
committer | Max Kellermann <max@duempel.org> | |
Thu, 27 Nov 2008 15:58:14 +0000 (16:58 +0100) |
When the cursor was at the end of a list and the user pressed 'n',
ncmpc would hang in an endless loop forever. The same bug was fixed
in the backwards search.
ncmpc would hang in an endless loop forever. The same bug was fixed
in the backwards search.
src/list_window.c | patch | blob | history |
diff --git a/src/list_window.c b/src/list_window.c
index 9f34f539fc6d212dfcfdff9643611128bab8238a..46858ee2bb5d2862b9a16dee7fd257a536c2ec7a 100644 (file)
--- a/src/list_window.c
+++ b/src/list_window.c
unsigned i = lw->selected + 1;
const char *label;
- while (wrap || i == lw->selected + 1) {
+ do {
while ((label = callback(i,&h,callback_data))) {
if (str && label && strcasestr(label, str)) {
lw->selected = i;
i=0; /* first item */
screen_bell();
}
- }
+ } while (wrap);
return 1;
}
if (rows == 0)
return 1;
- while (wrap || i == (int)lw->selected - 1) {
+ do {
while (i >= 0 && (label = callback(i,&h,callback_data))) {
if( str && label && strcasestr(label, str) ) {
lw->selected = i;
i = rows - 1; /* last item */
screen_bell();
}
- }
+ } while (wrap);
+
return 1;
}