summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2013-09-18 21:22:49 +0200
committerSven Eden <yamakuzure@gmx.net>2013-09-18 21:22:49 +0200
commit5e74a1084a35f8ebe312c4af63e13a468f410886 (patch)
tree67f03732099c43dbef48c936f214f0c960ef8a69
parentAdded wrapped selection to status line (diff)
downloadufed-5e74a1084a35f8ebe312c4af63e13a468f410886.tar.gz
ufed-5e74a1084a35f8ebe312c4af63e13a468f410886.tar.bz2
ufed-5e74a1084a35f8ebe312c4af63e13a468f410886.zip
drawFlag() fixed a definite endless loop
-rw-r--r--ufed-curses-checklist.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ufed-curses-checklist.c b/ufed-curses-checklist.c
index b5eef00..2ac712b 100644
--- a/ufed-curses-checklist.c
+++ b/ufed-curses-checklist.c
@@ -185,6 +185,7 @@ static void read_flags(void)
bottomline = lineNum;
}
+
static int drawflag(sFlag* flag, bool highlight)
{
// Return early if there is nothing to display:
@@ -236,8 +237,10 @@ static int drawflag(sFlag* flag, bool highlight)
while ( (idx < flag->ndesc) && (line < lHeight) ) {
// Continue if any of the filters apply:
- if (newDesc && !isDescLegal(flag, idx))
+ if (newDesc && !isDescLegal(flag, idx)) {
+ ++idx;
continue;
+ }
// If the flag name and state are drawn, following lines
// need to start with spaces
@@ -274,7 +277,7 @@ static int drawflag(sFlag* flag, bool highlight)
// 1: Print left side info
if (!hasHead || newDesc)
- // Note: If either is false, the buffer is blanked already
+ // Note: If both are false, the buffer is blanked already
printFlagInfo(buf, flag, idx, !hasHead, newDesc);
// At this point buf is guaranteed to be filled up to minwidth + 8
@@ -284,6 +287,8 @@ static int drawflag(sFlag* flag, bool highlight)
if (eWrap_wrap == e_wrap) {
setFlagWrapDraw(flag, idx, &wrapPart, &pos, &length, &wrapFirst);
wrapPart = wrapPart->next;
+ if (newDesc && wrapPart)
+ newDesc = false;
}
// The right side of buf can be added now: