From 58d50f44cd482b1decef80bbeb6bb08f847c3673 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 25 Dec 2019 11:14:18 -0700 Subject: [PATCH] Support systems that have nl_langinfo(3) but not the CODESET define. Fixes compilation on old NetBSD versions. --- plugins/sudoers/logging.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/sudoers/logging.c b/plugins/sudoers/logging.c index 32a07a9aa..156da5d62 100644 --- a/plugins/sudoers/logging.c +++ b/plugins/sudoers/logging.c @@ -894,10 +894,10 @@ send_mail(const char *fmt, ...) (void) fputc(*p, mail); } -#ifdef HAVE_NL_LANGINFO +#if defined(HAVE_NL_LANGINFO) && defined(CODESET) if (strcmp(def_sudoers_locale, "C") != 0) (void) fprintf(mail, "\nContent-Type: text/plain; charset=\"%s\"\nContent-Transfer-Encoding: 8bit", nl_langinfo(CODESET)); -#endif /* HAVE_NL_LANGINFO */ +#endif /* HAVE_NL_LANGINFO && CODESET */ if ((timestr = get_timestr(time(NULL), def_log_year)) == NULL) timestr = "invalid date";