summaryrefslogtreecommitdiff
path: root/distrib
diff options
context:
space:
mode:
authorRobert Peichaer <rpe@cvs.openbsd.org>2014-01-26 19:01:04 +0000
committerRobert Peichaer <rpe@cvs.openbsd.org>2014-01-26 19:01:04 +0000
commit36a279669ad0ac0693992ec0efd5652b002a5dac (patch)
tree5543763708d0abace51f564ec6be10a377863423 /distrib
parent9eddefafcd7b047b300910476ff7d488702a9b1f (diff)
let ask_yn() return 0 for yes, 1 for no
from and OK halex@
Diffstat (limited to 'distrib')
-rw-r--r--distrib/miniroot/install.sub7
1 files changed, 4 insertions, 3 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 41b0dde0def..a6c49cf7fa9 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,4 +1,4 @@
-# $OpenBSD: install.sub,v 1.733 2014/01/24 01:12:10 halex Exp $
+# $OpenBSD: install.sub,v 1.734 2014/01/26 19:01:03 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
@@ -436,6 +436,7 @@ function ask_until {
# $2 = the default answer (assumed to be 'n' if empty).
#
# Return 'y' or 'n' in $resp.
+# Exit code: yes => 0, no => 1
ask_yn() {
local _q=$1 _a=${2:-no}
typeset -l _resp
@@ -444,8 +445,8 @@ ask_yn() {
ask "$_q" "$_a"
_resp=$resp
case $_resp in
- y|yes) resp=y ; return ;;
- n|no) resp=n ; return ;;
+ y|yes) resp=y; return 0;;
+ n|no) resp=n; return 1;;
esac
echo "'$resp' is not a valid choice."
$auto && exit 1