#
# InspIRCd -- Internet Relay Chat Daemon
#
-# Copyright (C) 2014-2017 Peter Powell <petpow@saberuk.com>
+# Copyright (C) 2014-2017, 2019 Sadie Powell <sadie@witchery.services>
#
# 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
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($$$;$) {