Fix a bug in getbootparam()
authorFrank Terbeck <ft@bewatermyfriend.org>
Wed, 9 Sep 2009 18:42:08 +0000 (20:42 +0200)
committerFrank Terbeck <ft@bewatermyfriend.org>
Wed, 9 Sep 2009 18:42:08 +0000 (20:42 +0200)
Reported-by: Ulrich Dangel <mru@grml.org>
autoconfig.functions

index 50fdf81..b0a6d9b 100755 (executable)
@@ -47,10 +47,14 @@ fi
 # Get a bootoption's parameter: read boot command line and either
 # echo last parameter's argument or return false.
 getbootparam(){
-  case "$CMDLINE" in
-    *$1=*)
-      result="${CMDLINE##* $1=}"
-      result="${result%%[      ]*}"
+  local line
+  local ws
+  ws='  '
+  line=" $CMDLINE "
+  case "$line" in
+    *[${ws}]"$1="*)
+      result="${line##*[$ws]$1=}"
+      result="${result%%[$ws]*}"
       echo "$result"
       return 0 ;;
     *) # no match?