b201f014b68a5c1f35b5a5b93b98f30b4a9eaab0 — Cristian Adri├ín Ontivero a month ago
Correctly trim trailing newlines in $() expansions

Fixes https://github.com/emersion/mrsh/issues/74
1 files changed, 1 insertions(+), 1 deletions(-)

M shell/task/word.c
M shell/task/word.c => shell/task/word.c +1 -1
@@ 185,7 185,7 @@ tw->fd = -1;
  
  			// Trim newlines at the end
- 			ssize_t i = buf.len - 1;
+ 			ssize_t i = buf.len - 2;
  			while (i >= 0 && buf.data[i] == '\n') {
  				buf.data[i] = '\0';
  				--i;