From 6a6cdf5246fc2ad5a2d65a12565fb6ba5d5151bd Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 7 Nov 2008 16:56:04 +0000 Subject: [PATCH] When using the `read` builtin to split newlines in e* function arguments, use $REPLY in order to ensure that whitespace in each line is correctly preserved. Thanks to Joe Peterson for reporting. svn path=/main/trunk/; revision=11820 --- bin/isolated-functions.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index bb56ca1a8..768baf612 100755 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -170,8 +170,8 @@ elog_base() { return 1 ;; esac - echo -e "$@" | while read line ; do - echo "${messagetype} ${line}" >> \ + echo -e "$@" | while read ; do + echo "$messagetype $REPLY" >> \ "${T}/logging/${EBUILD_PHASE:-other}" done return 0 @@ -180,8 +180,8 @@ elog_base() { eqawarn() { elog_base QA "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo -e "$@" | while read line ; do - vecho -e " ${WARN}*${NORMAL} ${line}" >&2 + echo -e "$@" | while read ; do + vecho -e " $WARN*$NORMAL $REPLY" >&2 done LAST_E_CMD="eqawarn" return 0 @@ -190,8 +190,8 @@ eqawarn() { elog() { elog_base LOG "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo -e "$@" | while read line ; do - echo -e " ${GOOD}*${NORMAL} ${line}" + echo -e "$@" | while read ; do + echo -e " $GOOD*$NORMAL $REPLY" done LAST_E_CMD="elog" return 0 @@ -218,8 +218,8 @@ esyslog() { einfo() { elog_base INFO "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo -e "$@" | while read line ; do - echo -e " ${GOOD}*${NORMAL} ${line}" + echo -e "$@" | while read ; do + echo -e " $GOOD*$NORMAL $REPLY" done LAST_E_CMD="einfo" return 0 @@ -236,8 +236,8 @@ einfon() { ewarn() { elog_base WARN "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo -e "$@" | while read line ; do - echo -e " ${WARN}*${NORMAL} ${RC_INDENTATION}${line}" >&2 + echo -e "$@" | while read ; do + echo -e " $WARN*$NORMAL $RC_INDENTATION$REPLY" >&2 done LAST_E_CMD="ewarn" return 0 @@ -246,8 +246,8 @@ ewarn() { eerror() { elog_base ERROR "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo -e "$@" | while read line ; do - echo -e " ${BAD}*${NORMAL} ${RC_INDENTATION}${line}" >&2 + echo -e "$@" | while read ; do + echo -e " $BAD*$NORMAL $RC_INDENTATION$REPLY" >&2 done LAST_E_CMD="eerror" return 0 -- 2.26.2