Skip to content

Commit ce6b2b8

Browse files
committed
Locale (Linux): use environment variable if available
In some machine `setlocale(LC_MESSAGES, NULL)` returns `C` for some reason.
1 parent 48d1980 commit ce6b2b8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/detection/locale/locale_linux.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44

55
void ffDetectLocale(FFstrbuf* result)
66
{
7+
ffStrbufAppendS(result, getenv("LC_MESSAGES"));
8+
if(result->length > 0)
9+
return;
10+
11+
ffStrbufAppendS(result, getenv("LANG"));
12+
if(result->length > 0)
13+
return;
14+
715
#ifdef LC_MESSAGES
816
ffStrbufAppendS(result, setlocale(LC_MESSAGES, NULL));
917

0 commit comments

Comments
 (0)