From 412e05688d8d870932c8c00eb8f414e9d159dbdf Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Wed, 9 Sep 2009 20:42:08 +0200 Subject: [PATCH] Fix a bug in getbootparam() Reported-by: Ulrich Dangel --- autoconfig.functions | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/autoconfig.functions b/autoconfig.functions index 50fdf81..b0a6d9b 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -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? -- 2.1.4