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