1
0
Fork 0

[gettext] Let it work also on Windows

When elinks.exe is located in the src subdirectory,
.gmo files are read from the po subdirectory.
This commit is contained in:
Witold Filipczyk 2023-12-15 10:36:17 +01:00
parent 93e9ac1b4c
commit 6c32ce3c61
1 changed files with 9 additions and 2 deletions

View File

@ -216,8 +216,15 @@ _nl_free_domain_conv(struct loaded_domain *domain)
static struct string *
add_filename_to_string(struct string *str, struct loaded_l10nfile *domain_file)
{
char *slash = strrchr(program.path, '/');
size_t dirnamelen = (slash ? slash - program.path + 1 : 0);
char *sep;
size_t dirnamelen;
for (sep = program.path + strlen((const char *)program.path); sep > program.path; sep--) {
if (dir_sep(sep[0])) {
break;
}
}
dirnamelen = (sep ? sep - program.path + 1 : 0);
/* Check if elinks is being run from the source tree. */
if (dirnamelen < 4