diff options
author | 2013-11-28 22:56:05 +0000 | |
---|---|---|
committer | 2013-11-28 22:56:05 +0000 | |
commit | 9c0bbfe47e50afe44a08e52d1c3e83e2671c1e22 (patch) | |
tree | 53de2400868215215f6a3f43c47e5f620d702c17 | |
parent | make ask_which bail out on a missing response in the autoinstall case (diff) | |
download | wireguard-openbsd-9c0bbfe47e50afe44a08e52d1c3e83e2671c1e22.tar.xz wireguard-openbsd-9c0bbfe47e50afe44a08e52d1c3e83e2671c1e22.zip |
simplify the check if a responsefile line is valid
idea from and ok halex@
-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 |