Display function creates wrong indentation of result column (#237)

This commit is contained in:
atao60 2016-07-26 15:00:05 +02:00 committed by Michael Boelen
parent bfefb1c02f
commit 0b5b4a47a3
2 changed files with 7 additions and 2 deletions

View File

@ -510,8 +510,10 @@
fi
if [ ${SHOW} -eq 1 ]; then
# Display (counting with -m instead of -c, to support language locale)
LINESIZE=`echo "${TEXT}" | wc -m | tr -d ' '`
# 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...
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
if [ ${SPACES} -lt 0 ]; then SPACES=0; fi

3
lynis
View File

@ -49,6 +49,9 @@
# Version number of report files (when format changes in future)
REPORT_version_major="1"; REPORT_version_minor="0"
REPORT_version="${REPORT_version_major}.${REPORT_version_minor}"
DISPLAY_LANG=$LANG # requiered by function Display to deal with multi-bytes characters.
#
#################################################################################
#