From 054a94e6c9017ea7ca2d606908fa7be960742ac7 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 19 Nov 2013 09:45:13 -0700 Subject: [PATCH] Add definition of U_ for --disable-nsl Don't define warning_gettext if --disable-nsl Bug #621; from Daniel Richard G. --- include/gettext.h | 1 + plugins/sudoers/locale.c | 2 ++ src/locale_stub.c | 2 ++ 3 files changed, 5 insertions(+) diff --git a/include/gettext.h b/include/gettext.h index 49d3ef114..c5cac50ea 100644 --- a/include/gettext.h +++ b/include/gettext.h @@ -64,6 +64,7 @@ */ # define _(String) String # define N_(String) String +# define U_(String) String # define textdomain(Domain) # define bindtextdomain(Package, Directory) # define ngettext(String, String_Plural, N) \ diff --git a/plugins/sudoers/locale.c b/plugins/sudoers/locale.c index fad13ed70..822aaa4a7 100644 --- a/plugins/sudoers/locale.c +++ b/plugins/sudoers/locale.c @@ -108,6 +108,7 @@ sudoers_setlocale(int newlocale, int *prevlocale) return res ? true : false; } +#ifdef HAVE_LIBINTL_H char * warning_gettext(const char *msgid) { @@ -120,3 +121,4 @@ warning_gettext(const char *msgid) return msg; } +#endif /* HAVE_LIBINTL_H */ diff --git a/src/locale_stub.c b/src/locale_stub.c index 11f2b0072..91bc71dd7 100644 --- a/src/locale_stub.c +++ b/src/locale_stub.c @@ -25,9 +25,11 @@ #include "fatal.h" #include "gettext.h" +#ifdef HAVE_LIBINTL_H /* No need to swap locales in the front end. */ char * warning_gettext(const char *msgid) { return gettext(msgid); } +#endif /* HAVE_LIBINTL_H */ -- 2.40.0