]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix trim sed fallback
authorRoy Marples <roy@marples.name>
Mon, 20 Jan 2014 15:19:11 +0000 (15:19 +0000)
committerRoy Marples <roy@marples.name>
Mon, 20 Jan 2014 15:19:11 +0000 (15:19 +0000)
dhcpcd-run-hooks.in

index 1bcbd495ad8c6a794f94fb849f2a52de35c558b1..e0ad618c44b40d68a0a1adb9dfd6ca218c558528 100644 (file)
@@ -69,7 +69,7 @@ trim()
        if [ -z "$var" ]; then
                # So it seems our shell doesn't support wctype(3) patterns
                # Fall back to sed
-               var=$(echo "$var" | sed -e 's/^[ \t]*//;s/[ \t]*$//')
+               var=$(echo "$*" | sed -e 's/^[[:space:]]*//;s/[[:space:]]*$//')
        fi
        printf %s "$var"
 }