prev: apply fixes from code review

Addresses the following review comments:
- eb28e5e72e (r1501466125)
- eb28e5e72e (r1501466232)

This will be squashed into the previous commit pending review.
This commit is contained in:
Qyriad 2024-02-25 22:19:37 -07:00
parent eb28e5e72e
commit 9aef09586e

View File

@ -71,13 +71,13 @@ _logHook() {
else
while IFS= read -r hookExprLine; do
# These lines often have indentation,
# so let's removing leading whitespace.
# so let's remove leading whitespace.
hookExprLine="${hookExprLine#"${hookExprLine%%[![:space:]]*}"}"
# If this line wasn't entirely whitespace,
# then add it to our output.
if [[ -n "$hookExprLine" ]]; then
exprToOutput+="$hookExprLine\\n "
fi
if [[ -n "$hookExprLine" ]]; then
exprToOutput+="$hookExprLine\\n "
fi
done <<< "$hookExpr"
# And then remove the final, unnecessary, \n