version 1.29, 2015/05/29 12:26:28 |
version 1.29.16.2, 2020/04/13 08:03:12 |
Line 229 lookup_category(int category) |
|
Line 229 lookup_category(int category) |
|
return NULL; |
return NULL; |
} |
} |
|
|
|
#define MAXBUFLEN 1024 |
/* |
/* |
* XPG syntax: language[_territory[.codeset]][@modifier] |
* XPG syntax: language[_territory[.codeset]][@modifier] |
* XXX boundary check on "result" is lacking |
* XXX boundary check on "result" is lacking |
Line 236 lookup_category(int category) |
|
Line 237 lookup_category(int category) |
|
static const char * |
static const char * |
split_locale(const char *lname) |
split_locale(const char *lname) |
{ |
{ |
char buf[BUFSIZ], tmp[BUFSIZ]; |
char buf[MAXBUFLEN], tmp[2 * MAXBUFLEN]; |
char *l, *t, *c, *m; |
char *l, *t, *c, *m; |
static char result[BUFSIZ]; |
static char result[4 * MAXBUFLEN]; |
|
|
memset(result, 0, sizeof(result)); |
memset(result, 0, sizeof(result)); |
|
|
Line 329 lookup_mofile(char *buf, size_t len, con |
|
Line 330 lookup_mofile(char *buf, size_t len, con |
|
continue; |
continue; |
#endif |
#endif |
|
|
snprintf(buf, len, "%s/%s/%s/%s.mo", dir, p, |
int rv = snprintf(buf, len, "%s/%s/%s/%s.mo", dir, p, |
category, domainname); |
category, domainname); |
|
if (rv > (int)len) |
|
return NULL; |
if (stat(buf, &st) < 0) |
if (stat(buf, &st) < 0) |
continue; |
continue; |
if ((st.st_mode & S_IFMT) != S_IFREG) |
if ((st.st_mode & S_IFMT) != S_IFREG) |
Line 942 dcngettext(const char *domainname, const |
|
Line 945 dcngettext(const char *domainname, const |
|
unsigned long int n, int category) |
unsigned long int n, int category) |
{ |
{ |
const char *msgid; |
const char *msgid; |
char path[PATH_MAX]; |
char path[PATH_MAX+1]; |
const char *lpath; |
const char *lpath; |
static char olpath[PATH_MAX]; |
static char olpath[PATH_MAX]; |
const char *cname = NULL; |
const char *cname = NULL; |