From: Thomas Roessler Date: Thu, 7 Sep 2000 09:34:01 +0000 (+0000) Subject: Make the use of nl_langinfo(YESEXPR/NOEXPR) more robust. Problem X-Git-Tag: mutt-1-3-9-rel~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a3b5a2c30518a704ad6adbf1d395d7907476308;p=mutt Make the use of nl_langinfo(YESEXPR/NOEXPR) more robust. Problem noted by Wolfgang Baumann . --- diff --git a/curs_lib.c b/curs_lib.c index 6cec1087..9e75a901 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -151,13 +151,22 @@ int mutt_yesorno (const char *msg, int def) char *no = _("no"); #ifdef HAVE_LANGINFO_YESEXPR + char *expr; regex_t reyes; regex_t reno; - int reyes_ok = ! regcomp (& reyes, nl_langinfo (YESEXPR), REG_NOSUB); - int reno_ok = ! regcomp (& reno, nl_langinfo (NOEXPR), REG_NOSUB); + int reyes_ok = 0; + int reno_ok = 0; char answer[2]; answer[1] = 0; + + if ((expr = nl_langinfo (YESEXPR)) && *expr && + !regcomp (&reyes, expr, REG_NOSUB)) + reyes_ok = 1; + + if ((expr = nl_langinfo (NOEXPR)) && *expr && + !regcomp (&reno, expr, REG_NOSUB)) + reno_ok = 1; #endif CLEARLINE(LINES-1);