From 36a279669ad0ac0693992ec0efd5652b002a5dac Mon Sep 17 00:00:00 2001 From: Robert Peichaer Date: Sun, 26 Jan 2014 19:01:04 +0000 Subject: let ask_yn() return 0 for yes, 1 for no from and OK halex@ --- distrib/miniroot/install.sub | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'distrib') 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 -- cgit v1.2.3