X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=make%2Fconsole.pm;h=98442ff771975e4eeda02288b7cfa4d5086faf2b;hb=9cdd7c70ee8faa2d8d37078aa188423a7abfa214;hp=0d3c1b38d6f962fe96dda066346cb2ecdda5a1a3;hpb=c6e40d36b42a7ebf832c3a57d2816a47ee9c9a76;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/make/console.pm b/make/console.pm index 0d3c1b38d..98442ff77 100644 --- a/make/console.pm +++ b/make/console.pm @@ -1,7 +1,7 @@ # # InspIRCd -- Internet Relay Chat Daemon # -# Copyright (C) 2014-2017 Peter Powell +# Copyright (C) 2014-2017, 2019 Sadie Powell # # This file is part of InspIRCd. InspIRCd is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public @@ -92,8 +92,12 @@ sub print_warning { sub prompt_bool($$$) { my ($interactive, $question, $default) = @_; - my $answer = prompt_string($interactive, $question, $default ? 'y' : 'n'); - return $answer =~ /y/i; + while (1) { + my $answer = prompt_string($interactive, $question, $default ? 'yes' : 'no'); + return 1 if $answer =~ /^y(?:es)?$/i; + return 0 if $answer =~ /^no?$/i; + print_warning "\"$answer\" is not \"yes\" or \"no\". Please try again.\n"; + } } sub prompt_dir($$$;$) {