Skip to content

Commit

Permalink
Fix segfault regression when NLS is enabled but libintl.h cannot be f…
Browse files Browse the repository at this point in the history
…ound

popt 1.18, apparently commit 8330225,
introduced a regression with a configuration where NLS is enabled but
libintl.h cannot be found.

Require libintl.h to be present for the translation machinery to be used.
This probably isn't the most optimal way to solve it, but not crashing is
much better than crashing...

Fixes: #32
  • Loading branch information
pmatilai committed Jun 6, 2022
1 parent b27964c commit a854ade
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/poptint.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ POPT_next_char (const char *str)

#if !defined(POPT_fprintf) /* XXX lose all the goop ... */

#if defined(HAVE_DCGETTEXT)
#if defined(ENABLE_NLS) && defined(HAVE_LIBINTL_H) && defined(HAVE_DCGETTEXT)
/*
* Rebind a "UTF-8" codeset for popt's internal use.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/poptint.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const char *POPT_next_char (const char *str);
#define _(foo) foo
#endif

#if defined(ENABLE_NLS) && defined(HAVE_DCGETTEXT)
#if defined(ENABLE_NLS) && defined(HAVE_LIBINTL_H) && defined(HAVE_DCGETTEXT)
#define D_(dom, str) POPT_dgettext(dom, str)
#define POPT_(foo) D_("popt", foo)
#else
Expand Down

0 comments on commit a854ade

Please sign in to comment.