~exec64/imv-devel

imv: Remove trailing whitespace from wordexp-ed strings v2 PROPOSED

Ivan Oleynikov: 1
 Remove trailing whitespace from wordexp-ed strings

 1 files changed, 1 insertions(+), 1 deletions(-)
#773529 archlinux.yml success
#773530 ubuntu.yml success
#773531 fedora.yml success
#773532 freebsd.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~exec64/imv-devel/patches/32741/mbox | git am -3
Learn more about email & git

[PATCH imv v2] Remove trailing whitespace from wordexp-ed strings Export this patch

Previous implementation was always leaving a trailing whitespace at the
end of the expanded string (used in window title, description text,
etc.). Now it doesn't happen.
---
 src/imv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/imv.c b/src/imv.c
index 8380a12..ba411f6 100644
--- a/src/imv.c
+++ b/src/imv.c
@@ -2002,7 +2002,7 @@ static size_t generate_env_text(struct imv *imv, char *buf, size_t buf_len, cons
  setenv("IFS", "", 1);
  if (wordexp(format, &word, 0) == 0) {
    for (size_t i = 0; i < word.we_wordc; ++i) {
      len += snprintf(buf + len, buf_len - len, "%s ", word.we_wordv[i]);
      len += snprintf(buf + len, buf_len - len, (i ? " %s" : "%s"), word.we_wordv[i]);
    }
    wordfree(&word);
  } else {
-- 
2.36.1
imv/patches: SUCCESS in 4m28s

[Remove trailing whitespace from wordexp-ed strings][0] v2 from [Ivan Oleynikov][1]

[0]: https://lists.sr.ht/~exec64/imv-devel/patches/32741
[1]: mailto:ivan.oleynikov95@gmail.com

✓ #773531 SUCCESS imv/patches/fedora.yml    https://builds.sr.ht/~exec64/job/773531
✓ #773529 SUCCESS imv/patches/archlinux.yml https://builds.sr.ht/~exec64/job/773529
✓ #773532 SUCCESS imv/patches/freebsd.yml   https://builds.sr.ht/~exec64/job/773532
✓ #773530 SUCCESS imv/patches/ubuntu.yml    https://builds.sr.ht/~exec64/job/773530