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 DD1DF1381F3 for ; Wed, 11 Sep 2013 06:04:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4B361E0C2D; Wed, 11 Sep 2013 06:04:10 +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 7597AE0C2D for ; Wed, 11 Sep 2013 06:04:09 +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 5EEFF33E974 for ; Wed, 11 Sep 2013 06:04:08 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 19F39E5463 for ; Wed, 11 Sep 2013 06:04:07 +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: <1378793940.7fe7d5d8618b1adfcd5f95b529dfcb4843f5b363.yamakuzure@gentoo> Subject: [gentoo-commits] proj/ufed:master commit in: / X-VCS-Repository: proj/ufed X-VCS-Files: ufed-curses-checklist.c ufed-curses-help.c X-VCS-Directories: / X-VCS-Committer: yamakuzure X-VCS-Committer-Name: Sven Eden X-VCS-Revision: 7fe7d5d8618b1adfcd5f95b529dfcb4843f5b363 X-VCS-Branch: master Date: Wed, 11 Sep 2013 06:04:07 +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: 3306c444-6add-4297-ba36-2a685e3112ef X-Archives-Hash: a55c41a6ea5893699a63b1a456dcc43c commit: 7fe7d5d8618b1adfcd5f95b529dfcb4843f5b363 Author: Sven Eden gmx net> AuthorDate: Tue Sep 10 06:19:00 2013 +0000 Commit: Sven Eden gmx de> CommitDate: Tue Sep 10 06:19:00 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/ufed.git;a=commit;h=7fe7d5d8 Added reading of the new incoming alternative description line and its addition to the flag descriptions. --- ufed-curses-checklist.c | 23 ++++++++++++++--------- ufed-curses-help.c | 4 ++-- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/ufed-curses-checklist.c b/ufed-curses-checklist.c index 5d7179e..978e2f5 100644 --- a/ufed-curses-checklist.c +++ b/ufed-curses-checklist.c @@ -91,7 +91,7 @@ static void read_flags(void) size_t fullWidth = 0; struct { int start, end; - } name, desc, pkg, state; + } name, desc, desc_alt, pkg, state; if(input == NULL) ERROR_EXIT(-1, "fdopen failed with error %d\n", errno); @@ -126,15 +126,17 @@ static void read_flags(void) /* read description(s) and determine flag status */ for (int i = 0; i < ndescr; ++i) { - desc.start = desc.end = -1; - pkg.start = pkg.end = -1; - state.start = state.end = -1; + desc.start = desc.end = -1; + desc_alt.start = desc_alt.end = -1; + pkg.start = pkg.end = -1; + state.start = state.end = -1; line = getline(input); if (!line) break; - if ( (sscanf(line, "\t%n%*[^\t]%n\t (%n%*[^)]%n) [%n%*[ +-]%n%c", + if ( (sscanf(line, "\t%n%*[^\t]%n\t%n%*[^\t]%n\t (%n%*[^)]%n) [%n%*[ +-]%n%c", &desc.start, &desc.end, + &desc_alt.start, &desc_alt.end, &pkg.start, &pkg.end, &state.start, &state.end, &endChar) != 1) @@ -146,13 +148,16 @@ static void read_flags(void) ERROR_EXIT(-1, "Illegal description stats on line %d:\n\"%s\"\n", lineNum + 1, line); // Add description line to flag: - line[desc.end] = '\0'; - line[state.end] = '\0'; + line[desc.end] = '\0'; + line[desc_alt.end] = '\0'; + line[state.end] = '\0'; if ( (pkg.end - pkg.start) > 1) { line[pkg.end] = '\0'; - fullWidth = addFlagDesc(newFlag, &line[pkg.start], &line[desc.start], &line[state.start]); + fullWidth = addFlagDesc(newFlag, &line[pkg.start], &line[desc.start], + &line[desc_alt.start], &line[state.start]); } else - fullWidth = addFlagDesc(newFlag, NULL, &line[desc.start], &line[state.start]); + fullWidth = addFlagDesc(newFlag, NULL, &line[desc.start], + &line[desc_alt.start], &line[state.start]); // Note new max length if this line is longest: if (fullWidth > maxDescWidth) diff --git a/ufed-curses-help.c b/ufed-curses-help.c index 7dfbf93..8fce938 100644 --- a/ufed-curses-help.c +++ b/ufed-curses-help.c @@ -258,9 +258,9 @@ static void init_lines(void) if (n) { memcpy(buf, word, n); buf[n++] = '\0'; - addFlagDesc(line, NULL, buf, "+ "); + addFlagDesc(line, NULL, buf, NULL, "+ "); } else - addFlagDesc(line, NULL, " ", "+ "); + addFlagDesc(line, NULL, " ", NULL, "+ "); // Advance behind current spaces while (word[n] == ' ')