--- rc.autofs.in.sav	2005-04-11 04:30:54.000000000 -0700
+++ rc.autofs.in	2005-07-27 12:48:33.000000000 -0700
@@ -248,11 +248,13 @@
 		# those particular options out.
 		: echo DAEMONOPTIONS OPTIONS $daemonoptions $options
 		startupoptions=
-		if echo "$options" | grep -qE -- '\B-(t\b|-timeout\b=)' ;
+		if echo " $options " | \
+		    grep -qE -- '[[:space:]]-(t[[:space:][:digit:]]|-timeout=)';
 		then
 		    startupoptions="--timeout=$(echo $options |\
 			sed 's/.*-\(t[^0-9]*\|-timeout\)[ \t=]*\([0-9][0-9]*\).*$/\2/g')"
-		elif echo "$daemonoptions" | grep -q -- '-t' ;
+		elif echo " $daemonoptions " | \
+		    grep -qE -- '[[:space:]]-(t[[:space:][:digit:]]|-timeout=)' ;
 		then
 		    # It's okay to be sloppy with DAEMONOPTIONS as there is no
 		    # possibility of conflicting with mount or map options.
@@ -261,7 +263,8 @@
 		fi
 
 		# Check for the ghost option
-		if echo "$daemonoptions $options" | grep -qE -- '\B-(g\b|-ghost\b)' ;
+		if echo " $daemonoptions $options " | \
+		    grep -qE -- '[[:space:]]-(g|-ghost)[[:space:]]' ;
 		then
 		    startupoptions="$startupoptions --ghost"
 		fi
@@ -272,15 +275,15 @@
 		    startupoptions="$startupoptions --ghost"
 		fi
 		# Check for verbose
-		if echo "$daemonoptions $options" | \
-					grep -qE -- '\B-(v\b|-verbose\b)' ;
+		if echo " $daemonoptions $options " | \
+			grep -qE -- '[[:space:]]-(v|-verbose)[[:space:]]' ;
 		then
 		    startupoptions="$startupoptions --verbose"
 		fi
 
 		# Check for debug
-		if echo "$daemonoptions $options" | \
-					grep -qE -- '\B-(d\b|-debug\b)' ;
+		if echo " $daemonoptions $options " | \
+			grep -qE -- '[[:space:]]-(d|-debug)[[:space:]]' ;
 		then
 		    startupoptions="$startupoptions --debug"
 		fi
