diff options
author | Robert Peichaer <rpe@cvs.openbsd.org> | 2013-11-28 22:56:06 +0000 |
---|---|---|
committer | Robert Peichaer <rpe@cvs.openbsd.org> | 2013-11-28 22:56:06 +0000 |
commit | d22d1a96816fd911c40e45780681111eb79cdcc5 (patch) | |
tree | ed4e9fed5dda55b42c09bc033cf4cca8e2c92dcd /distrib | |
parent | 585cb9306e11d7bf8bb0b6bb91a8ba45516a0d2a (diff) |
simplify the check if a responsefile line is valid
idea from and ok halex@
Diffstat (limited to 'distrib')
-rw-r--r-- | distrib/miniroot/install.sub | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index b24d0f2ab43..3125ba3a3ef 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,4 +1,4 @@ -# $OpenBSD: install.sub,v 1.704 2013/11/28 22:31:07 halex Exp $ +# $OpenBSD: install.sub,v 1.705 2013/11/28 22:56:05 rpe Exp $ # $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $ # # Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback @@ -294,10 +294,9 @@ _autorespond() { local _def=$2 _i=0 _l _val [[ -f $RESPONSEFILE ]] || return while IFS=' ' read -r _l; do + [[ $_l == [!#=]*=?* ]] || continue _key=${_l%%*([[:blank:]])=*} _val=${_l##*([!=])=*([[:blank:]])} - ((${#_key} != ${#_l})) || continue - [[ -n ${_key%%#*} && -n $_val ]] || continue [[ $_q == *"$_key"* ]] && resp=$_val && let _i++ done <$RESPONSEFILE ((_i == 1)) && return |