From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id F1D3A1381F3 for ; Fri, 20 Sep 2013 08:31:04 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5A222E0BDD; Fri, 20 Sep 2013 08:30:54 +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 EDC75E0BDD for ; Fri, 20 Sep 2013 08:30:43 +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 10D4733ED0F for ; Fri, 20 Sep 2013 08:30:43 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 6C984E546B for ; Fri, 20 Sep 2013 08:30:41 +0000 (UTC) From: "Sven Eden" 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" Message-ID: <1379605648.dd63f08b4cbc0f46e2a8b78e30d631b1032f0361.yamakuzure@gentoo> Subject: [gentoo-commits] proj/ufed:master commit in: / X-VCS-Repository: proj/ufed X-VCS-Files: ufed-curses-checklist.c ufed-curses-types.c X-VCS-Directories: / X-VCS-Committer: yamakuzure X-VCS-Committer-Name: Sven Eden X-VCS-Revision: dd63f08b4cbc0f46e2a8b78e30d631b1032f0361 X-VCS-Branch: master Date: Fri, 20 Sep 2013 08:30:41 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: aef0f861-bc7b-492d-897f-26b8ff238527 X-Archives-Hash: 15cfec9277c79e5606bccbae719c77a5 commit: dd63f08b4cbc0f46e2a8b78e30d631b1032f0361 Author: Sven Eden gmx net> AuthorDate: Thu Sep 19 15:47:28 2013 +0000 Commit: Sven Eden gmx de> CommitDate: Thu Sep 19 15:47:28 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/ufed.git;a=commit;h=dd63f08b calculateDescWrap() Fix offset of second part, this must be aware of the leading space and the surrounding brackets around the package list, too. --- ufed-curses-checklist.c | 4 ++-- ufed-curses-types.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ufed-curses-checklist.c b/ufed-curses-checklist.c index 9dff8e2..b77a6f7 100644 --- a/ufed-curses-checklist.c +++ b/ufed-curses-checklist.c @@ -286,7 +286,7 @@ static int drawflag(sFlag* flag, bool highlight) setFlagWrapDraw(flag, idx, &wrapPart, &pos, &length); // The right side of buf can be added now: - leftover = rightwidth - (int)length; + leftover = rightwidth - (int)length - (newDesc ? 0 : 2) - 1; pBuf = &buf[minwidth + (newDesc ? 8 : 10)]; sprintf(pBuf, "%-*.*s", (int)length, (int)length, @@ -295,7 +295,7 @@ static int drawflag(sFlag* flag, bool highlight) // Leftover characters on the right must be blanked: if (leftover > 0) - sprintf(pBuf + length, "%-*.*s", leftover, leftover, " "); + sprintf(pBuf + length, "%-*sX", leftover, " "); /* Set correct color set according to highlighting and status*/ if(highlight) diff --git a/ufed-curses-types.c b/ufed-curses-types.c index 14c9313..71d751a 100644 --- a/ufed-curses-types.c +++ b/ufed-curses-types.c @@ -304,7 +304,7 @@ int getFlagHeight (const sFlag* flag) int result = 0; if (flag) { - size_t maxLen = wWidth(List) - (minwidth + 8);; + size_t maxLen = wWidth(List) - (minwidth + 8); for (int i = 0; i < flag->ndesc; ++i) { if (isDescLegal(flag, i)) { if (eWrap_normal == e_wrap) @@ -575,7 +575,7 @@ static void calculateDescWrap(sDesc* desc) end = wLen - 1; // Step 2: Find last space character before end+1 - if ((end > start) && (' ' != pch[end])) { + if ((end > start) && (end < (wLen - 1)) && (' ' != pch[end])) { size_t newEnd = end; for (; (newEnd > start) && (' ' != pch[newEnd]) ; --newEnd) ; if (newEnd > start) @@ -611,12 +611,12 @@ static void calculateDescWrap(sDesc* desc) // Switch from pkg to desc pch = pDesc; wLen = dLen; - oLen = pLen + 2; + oLen = pLen + 3; // +2 for the brackets, + 1 for leading space } else { // Switch from desc to pkg pch = pPkg; wLen = pLen; - oLen = dLen + 2; + oLen = dLen + 1; // +1 for leading space } start = 0; } // End of having to swap pkg/desc