configure: add cleanws() function
authorMans Rullgard <mans@mansr.com>
Sun, 13 Feb 2011 13:06:53 +0000 (13:06 +0000)
committerMans Rullgard <mans@mansr.com>
Sun, 13 Feb 2011 16:22:14 +0000 (16:22 +0000)
This function removes leading and trailing spaces and collapses
multiple spaces into one.

Signed-off-by: Mans Rullgard <mans@mansr.com>
configure

index a310d25..01b092f 100755 (executable)
--- a/configure
+++ b/configure
@@ -313,6 +313,10 @@ sh_quote(){
     echo "$v"
 }
 
+cleanws(){
+    echo "$@" | sed 's/^ *//;s/  */ /g;s/ *$//'
+}
+
 filter(){
     pat=$1
     shift