diff --git a/neofetch b/neofetch index 8bebbaa6..bd1f2ccf 100755 --- a/neofetch +++ b/neofetch @@ -3263,19 +3263,10 @@ get_bold() { } trim() { - # When a string is passed to "echo" all trailing and leading - # whitespace is removed and inside the string multiple spaces are - # condensed into single spaces. - # - # The "set -f/+f" is here so that "echo" doesn't cause any expansion - # of special characters. - # - # The whitespace trim doesn't work with multiline strings so we use - # "${1//[[:space:]]/ }" to remove newlines before we trim the whitespace. - set -f - # shellcheck disable=2086 - builtin echo -E ${1//[[:space:]]/ } + # shellcheck disable=2048,2086 + set -- $* + printf "%s\\n" "${*//[[:space:]]/ }" set +f }