Support systems that have nl_langinfo(3) but not the CODESET define.

Fixes compilation on old NetBSD versions.
This commit is contained in:
Todd C. Miller
2019-12-25 11:14:18 -07:00
parent 8b571c59a5
commit 58d50f44cd

View File

@@ -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";