From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/eselect:master commit in: libs/, /
Date: Fri, 14 Mar 2014 19:43:25 +0000 (UTC) [thread overview]
Message-ID: <1394813434.6cfcd9b33e08157146d08783872635a0545f4ead.ulm@gentoo> (raw)
commit: 6cfcd9b33e08157146d08783872635a0545f4ead
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 14 16:02:20 2014 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Mar 14 16:10:34 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=6cfcd9b3
Don't output spurious whitespace in write_kv_list_entry.
* libs/output.bash.in (write_kv_list_entry): Don't output spurious
trailing whitespace if value is an empty string.
---
ChangeLog | 5 +++++
libs/output.bash.in | 8 +++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 6aad604..0566eeb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-03-14 Ulrich Müller <ulm@gentoo.org>
+
+ * libs/output.bash.in (write_kv_list_entry): Don't output spurious
+ trailing whitespace if value is an empty string.
+
2014-02-25 Ulrich Müller <ulm@gentoo.org>
* modules/news.eselect (accepted_languages): Suppress "C"
diff --git a/libs/output.bash.in b/libs/output.bash.in
index 140de9e..2681c8c 100644
--- a/libs/output.bash.in
+++ b/libs/output.bash.in
@@ -110,6 +110,13 @@ write_kv_list_entry() {
text=${key//\%%%??%%%/}
n=$(( 26 + ${#rindent} - ${#lindent} - ${#text} ))
+ text=${val//\%%%??%%%/}
+ if [[ -z ${text} ]]; then
+ # empty ${val}: end the line and be done
+ echo
+ return
+ fi
+
# if ${n} is less than or equal to zero then we have a long ${key}
# that will mess up the formatting of ${val}, so end the line, indent
# and let ${val} go on the next line. Don't start a new line when
@@ -126,7 +133,6 @@ write_kv_list_entry() {
echo -n -e "$(space ${n})${right}"
n=$(( 28 + ${#rindent} ))
- text=${val//\%%%??%%%/}
# only loop if it doesn't fit on the same line
if [[ $(( ${n} + ${#text} )) -ge ${cols} ]] && ! is_output_mode brief; then
local i=0 spc=""
next reply other threads:[~2014-03-14 19:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-14 19:43 Ulrich Müller [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-05-12 16:44 [gentoo-commits] proj/eselect:master commit in: libs/, / Ulrich Müller
2023-03-14 16:53 Ulrich Müller
2017-12-25 11:00 Ulrich Müller
2017-06-18 19:32 Ulrich Müller
2017-03-21 6:33 Ulrich Müller
2016-12-10 8:18 Ulrich Müller
2016-11-01 6:43 Ulrich Müller
2016-10-30 9:17 Ulrich Müller
2016-06-01 19:43 Ulrich Müller
2014-01-19 16:36 Ulrich Müller
2013-11-19 12:54 Ulrich Müller
2013-11-19 8:17 Ulrich Müller
2013-11-10 20:24 Ulrich Müller
2013-06-17 15:26 Ulrich Mueller
2013-01-05 13:47 Ulrich Mueller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1394813434.6cfcd9b33e08157146d08783872635a0545f4ead.ulm@gentoo \
--to=ulm@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox