summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c9b6ceb)
raw | patch | inline | side by side (parent: c9b6ceb)
author | Max Kellermann <max@duempel.org> | |
Wed, 15 Apr 2009 16:12:03 +0000 (18:12 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Wed, 15 Apr 2009 16:12:03 +0000 (18:12 +0200) |
Check if the numbers in selected_start and selected_end are correct in
the function list_window_check_selected().
the function list_window_check_selected().
src/list_window.c | patch | blob | history |
diff --git a/src/list_window.c b/src/list_window.c
index e14d6cfad4acb26c9ecdb869586c3f9f8c410442..7bdee1a4e67bc4fc46b2dbab8c22dac4c586f29b 100644 (file)
--- a/src/list_window.c
+++ b/src/list_window.c
if(lw->range_selection)
{
+ if (length == 0) {
+ lw->selected_start = 0;
+ lw->selected_end = 0;
+ lw->range_base = 0;
+ } else {
+ if (lw->selected_start >= length)
+ lw->selected_start = length - 1;
+ if (lw->selected_end >= length)
+ lw->selected_end = length - 1;
+ if (lw->range_base >= length)
+ lw->range_base = length - 1;
+ }
+
if(lw->range_base > lw->selected_end)
lw->selected_end = lw->selected;
if(lw->range_base < lw->selected_start)