diff options
author | atao60 <atao60@users.noreply.github.com> | 2016-07-26 16:00:05 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2016-07-26 16:00:05 +0300 |
commit | 0b5b4a47a350cf14e79480bb2c3650d4f209cfdf (patch) | |
tree | f2669f8c51890e6211035e73a2e0f1c1c562a2b2 /include | |
parent | bfefb1c02f177781247c9be7d13897eb1e79d119 (diff) |
Display function creates wrong indentation of result column (#237)
Diffstat (limited to 'include')
-rw-r--r-- | include/functions | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/functions b/include/functions index f40997d9..a5ab3dbc 100644 --- a/include/functions +++ b/include/functions @@ -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 |