trim: Remove additional space during trimming

I noticed this when I'm testing with -v enabled. Looks like the trim
function replaces any spaces with a space.

This fixes the problem where terminal program cannot be displayed
because of an additional space in PPID variable.
This commit is contained in:
Muhammad Herdiansyah 2018-08-25 18:44:41 +07:00
parent 4d129b50c1
commit e7a3f5cba2

View file

@ -3931,7 +3931,7 @@ trim() {
set -f
# shellcheck disable=2048,2086
set -- $*
printf '%s\n' "${*//[[:space:]]/ }"
printf '%s\n' "${*//[[:space:]]/}"
set +f
}