Skip to content

Commit a1797cc

Browse files
authored
fallback to C locale instead of fail
1 parent a34fdfc commit a1797cc

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

hack.patch

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/source/rofi.c b/source/rofi.c
2-
index 37ad16f0..58fca78a 100644
2+
index 37ad16f0..4f72a408 100644
33
--- a/source/rofi.c
44
+++ b/source/rofi.c
55
@@ -76,6 +76,19 @@
@@ -22,7 +22,25 @@ index 37ad16f0..58fca78a 100644
2222
/** Location of pidfile for this instance. */
2323
char *pidfile = NULL;
2424
/** Location of Cache directory. */
25-
@@ -1299,6 +1312,8 @@ int main(int argc, char *argv[]) {
25+
@@ -1083,10 +1096,14 @@ int main(int argc, char *argv[]) {
26+
27+
display_init(proxy);
28+
29+
+ /** Fallback to C locale instead of outright failing */
30+
if (setlocale(LC_ALL, "") == NULL) {
31+
- g_warning("Failed to set locale.");
32+
- cleanup();
33+
- return EXIT_FAILURE;
34+
+ g_warning("Failed to set locale, falling back to C locale.");
35+
+ if (setlocale(LC_ALL, "C") == NULL) {
36+
+ g_warning("Failed to set C locale – aborting.");
37+
+ cleanup();
38+
+ return EXIT_FAILURE;
39+
+ }
40+
}
41+
42+
TICK_N("Setup Locale");
43+
@@ -1299,6 +1316,8 @@ int main(int argc, char *argv[]) {
2644
rofi_icon_fetcher_init();
2745
TICK_N("Icon fetcher initialize");
2846

0 commit comments

Comments
 (0)