commit 4263b633197f4e32f9457b6026d7348627243599 parent dbacb9676253e8d36ddd457df444e15d87c22b5c Author: Natasha Kerensikova <natgh@instinctive.eu> Date: Sun, 27 Oct 2024 13:04:48 +0000 Leading whitespaces in trees are no longer lost Diffstat:
M | src/pashage.sh | | | 9 | +++++---- |
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/pashage.sh b/src/pashage.sh @@ -997,13 +997,14 @@ do_tree_item() { } # Add a tree prefix -# $1: prefix of the first line -# $2: prefix of the following lines +# $1: optional title before the first line +# $2: prefix of the first line +# $3: prefix of the following lines do_tree_prefix() { [ -n "$1" ] && printf '%s\n' "$1" - read -r LINE + IFS= read -r LINE printf '%s%s\n' "$2" "${LINE}" - while read -r LINE; do + while IFS= read -r LINE; do printf '%s%s\n' "$3" "${LINE}" done unset LINE