ansible-later: 2.0.22 -> 2.0.23
[NixPkgs.git] / pkgs / games / klavaro / trans_lang_get_similar.patch
blob3b6644c5f7f7d93efa0cf52e90fa469a19e57742
1 --- a/src/translation.c (revision 137)
2 +++ b/src/translation.c (working copy)
3 @@ -257,23 +257,23 @@
4 * Private auxiliar function
5 */
6 static gboolean
7 -trans_lang_get_similar (gchar * test)
8 +trans_lang_get_similar (gchar ** test)
10 gint i;
11 gchar aux_code_2[3];
13 /* Prefer C over en_GB for English variants other than en_GB. (Debian patch 02) */
14 - if (g_str_has_prefix (test, "en"))
15 + if (g_str_has_prefix (*test, "en"))
17 - g_free (test);
18 - test = g_strdup ("C");
19 + g_free (*test);
20 + *test = g_strdup ("C");
21 return (TRUE);
24 - if (g_str_equal (test, "C"))
25 + if (g_str_equal (*test, "C"))
26 return TRUE;
28 - strncpy (aux_code_2, test, 2);
29 + strncpy (aux_code_2, *test, 2);
30 aux_code_2[2] = '\0';
32 for (i = 0; i < lang_num; i++)
33 @@ -280,15 +280,15 @@
35 if (strstr (lang[i].code, aux_code_2))
37 - g_free (test);
38 - test = g_strdup (lang[i].code);
39 + g_free (*test);
40 + *test = g_strdup (lang[i].code);
41 break;
44 - if (i == lang_num && g_str_has_prefix (test, "en"))
45 + if (i == lang_num && g_str_has_prefix (*test, "en"))
47 - g_free (test);
48 - test = g_strdup ("C");
49 + g_free (*test);
50 + *test = g_strdup ("C");
51 return (TRUE);
53 return (i == lang_num ? FALSE : TRUE);
54 @@ -356,7 +356,7 @@
55 lang_ok = (i == 0 ? TRUE : FALSE);
56 break;
58 - lang_ok = trans_lang_get_similar (tmp_code);
59 + lang_ok = trans_lang_get_similar (&tmp_code);
60 if (lang_ok == TRUE)
61 break;
62 g_free (tmp_code);
63 @@ -368,7 +368,7 @@
64 tmp_code = g_win32_getlocale ();
65 lang_ok = trans_lang_is_available (tmp_code);
66 if (lang_ok == FALSE)
67 - lang_ok = trans_lang_get_similar (tmp_code);
68 + lang_ok = trans_lang_get_similar (&tmp_code);
69 #endif
71 if (tmp_code == NULL)