This function removes leading and trailing spaces and collapses multiple spaces into one. Signed-off-by: Mans Rullgard <mans@mansr.com> (cherry picked from commit bb7a22b5840e56c034227ad596b1165c03f2da27)
@@ -313,6 +313,10 @@ sh_quote(){
echo "$v"
}
+cleanws(){
+ echo "$@" | sed 's/^ *//;s/ */ /g;s/ *$//'
+}
+
filter(){
pat=$1
shift