Because gettext is allowed to do as it pleases...

...when it is fed with an empty string, let's workaround it by adding
a new function.
This commit is contained in:
Guillaume Melquiond 2004-12-05 18:24:44 +00:00
parent e986dc7ac0
commit be62da89b1
2 changed files with 7 additions and 0 deletions

View file

@ -4,6 +4,11 @@
#include <cstring>
char const *egettext(char const *msgid)
{
return msgid[0] == '\0' ? msgid : gettext(msgid);
}
const char* sgettext (const char *msgid)
{
const char *msgval = gettext (msgid);

View file

@ -5,6 +5,8 @@
// gettext-related declarations
#include <libintl.h>
const char* egettext (const char*);
const char* sgettext (const char*);
const char* dsgettext (const char * domainname, const char *msgid);
std::string vgettext (const char*,const string_map&);