From 49fa21d023feb89e236ad4d655d96dde3574560e Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 20 Jul 2017 23:46:15 -0400 Subject: main: Call setlocale() at startup to use the system locale --- util.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'util.c') diff --git a/util.c b/util.c index 81eeda0..0d7e17d 100644 --- a/util.c +++ b/util.c @@ -373,6 +373,16 @@ static int xrpmatch(const char *response) { ret = xrpregex(YESEXPR, response); if (ret == 0) { return 1; + } else if (ret != REG_NOMATCH) { + return -1; + } + + // Failsafe: always handle y/n + char c = response[0]; + if (c == 'n' || c == 'N') { + return 0; + } else if (c == 'y' || c == 'Y') { + return 1; } else { return -1; } -- cgit v1.2.3