From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-629069-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id A035E1381F3
	for <garchives@archives.gentoo.org>; Fri, 20 Sep 2013 08:30:45 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id EA82BE0B19;
	Fri, 20 Sep 2013 08:30:42 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 459F0E0B18
	for <gentoo-commits@lists.gentoo.org>; Fri, 20 Sep 2013 08:30:42 +0000 (UTC)
Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 47EA033EC8E
	for <gentoo-commits@lists.gentoo.org>; Fri, 20 Sep 2013 08:30:41 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by hornbill.gentoo.org (Postfix) with ESMTP id 6DFB9E5467
	for <gentoo-commits@lists.gentoo.org>; Fri, 20 Sep 2013 08:30:39 +0000 (UTC)
From: "Sven Eden" <sven.eden@gmx.de>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sven Eden" <sven.eden@gmx.de>
Message-ID: <1379532169.5e74a1084a35f8ebe312c4af63e13a468f410886.yamakuzure@gentoo>
Subject: [gentoo-commits] proj/ufed:master commit in: /
X-VCS-Repository: proj/ufed
X-VCS-Files: ufed-curses-checklist.c
X-VCS-Directories: /
X-VCS-Committer: yamakuzure
X-VCS-Committer-Name: Sven Eden
X-VCS-Revision: 5e74a1084a35f8ebe312c4af63e13a468f410886
X-VCS-Branch: master
Date: Fri, 20 Sep 2013 08:30:39 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: db9bbc12-2174-4435-b814-6a6cb942dfdd
X-Archives-Hash: bec65442df5a0381190a19334f166e82

commit:     5e74a1084a35f8ebe312c4af63e13a468f410886
Author:     Sven Eden <yamakuzure <AT> gmx <DOT> net>
AuthorDate: Wed Sep 18 19:22:49 2013 +0000
Commit:     Sven Eden <sven.eden <AT> gmx <DOT> de>
CommitDate: Wed Sep 18 19:22:49 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/ufed.git;a=commit;h=5e74a108

drawFlag() fixed a definite endless loop

---
 ufed-curses-checklist.c | 9 +++++++--
 1 file 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: