From abe700741d98232d945f1473f38a8cbbd121d460 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 1 May 2009 21:43:50 +0000 Subject: [PATCH] Make elog functions use read -r when splitting lines, so that backslashes intended for display will not be eaten. (trunk r13582) svn path=/main/branches/2.1.6/; revision=13583 --- bin/isolated-functions.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index 0d046cbda..8a7f899b9 100755 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -182,7 +182,7 @@ elog_base() { return 1 ;; esac - echo -e "$@" | while read ; do + echo -e "$@" | while read -r ; do echo "$messagetype $REPLY" >> \ "${T}/logging/${EBUILD_PHASE:-other}" done @@ -192,8 +192,8 @@ elog_base() { eqawarn() { elog_base QA "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo -e "$@" | while read ; do - vecho -e " $WARN*$NORMAL $REPLY" >&2 + echo -e "$@" | while read -r ; do + vecho " $WARN*$NORMAL $REPLY" >&2 done LAST_E_CMD="eqawarn" return 0 @@ -202,8 +202,8 @@ eqawarn() { elog() { elog_base LOG "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo -e "$@" | while read ; do - echo -e " $GOOD*$NORMAL $REPLY" + echo -e "$@" | while read -r ; do + echo " $GOOD*$NORMAL $REPLY" done LAST_E_CMD="elog" return 0 @@ -230,8 +230,8 @@ esyslog() { einfo() { elog_base INFO "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo -e "$@" | while read ; do - echo -e " $GOOD*$NORMAL $REPLY" + echo -e "$@" | while read -r ; do + echo " $GOOD*$NORMAL $REPLY" done LAST_E_CMD="einfo" return 0 @@ -248,8 +248,8 @@ einfon() { ewarn() { elog_base WARN "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo -e "$@" | while read ; do - echo -e " $WARN*$NORMAL $RC_INDENTATION$REPLY" >&2 + echo -e "$@" | while read -r ; do + echo " $WARN*$NORMAL $RC_INDENTATION$REPLY" >&2 done LAST_E_CMD="ewarn" return 0 @@ -258,8 +258,8 @@ ewarn() { eerror() { elog_base ERROR "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo -e "$@" | while read ; do - echo -e " $BAD*$NORMAL $RC_INDENTATION$REPLY" >&2 + echo -e "$@" | while read -r ; do + echo " $BAD*$NORMAL $RC_INDENTATION$REPLY" >&2 done LAST_E_CMD="eerror" return 0 -- 2.26.2