From e5c11991ef5e911ab8c015a73fa6cb8707c54eef Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Sun, 29 Oct 2017 11:26:25 +0100 Subject: [PATCH] Code enhancements and textual change --- include/functions | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/functions b/include/functions index dd80140c..87382c58 100644 --- a/include/functions +++ b/include/functions @@ -511,7 +511,7 @@ shift done - if [ "${RESULT}" = "" ]; then + if [ -z "${RESULT}" ]; then RESULTPART="" else if [ ${CRONJOB} -eq 0 ]; then @@ -521,7 +521,7 @@ fi fi - if [ ! "${TEXT}" = "" ]; then + if [ ! -z "${TEXT}" ]; then SHOW=0 if [ ${SHOW_WARNINGS_ONLY} -eq 1 ]; then if [ "${RESULT}" = "WARNING" ]; then SHOW=1; fi @@ -530,8 +530,8 @@ if [ ${SHOW} -eq 1 ]; then # Display: - # - counting with -m instead of -c, to support language locale - # - wc needs LANG to deal with multi-bytes characters but LANG has been unset in include/consts... + # - for full shells, count with -m instead of -c, to support language locale (older busybox does not have -m) + # - wc needs LANG to deal with multi-bytes characters but LANG has been unset in include/consts LINESIZE=$(export LC_ALL= ; export LANG="${DISPLAY_LANG}";echo "${TEXT}" | wc -m | tr -d ' ') if [ ${SHOWDEBUG} -eq 1 ]; then DEBUGTEXT=" [${PURPLE}DEBUG${NORMAL}]"; else DEBUGTEXT=""; fi if [ ${INDENT} -gt 0 ]; then SPACES=$((62 - INDENT - LINESIZE)); fi