summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2023-05-16 12:20:53 +0100
committerSimon McVittie <smcv@collabora.com>2023-05-17 11:35:44 +0100
commit99878f6356bcf8b6ba5e90d488662ca0da10b4d6 (patch)
tree9967d01a2cebc6b23948418b259c4ddc948706ed
parent35e7e682006898805b2861944226c20430dd3096 (diff)
downloadflatpak-99878f6356bcf8b6ba5e90d488662ca0da10b4d6.tar.gz
glib-backports: Resync g_get_language_names_with_category with GLib 2.76.2
- 0e7bf99e "Use "e" mode flag in fopen () calls for race-free setting of the close-on-exec flag" - Add #ifndef G_OS_WIN32, which is irrelevant for Flatpak but keeps the code textually equivalent to GLib's Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r--common/flatpak-glib-backports.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/common/flatpak-glib-backports.c b/common/flatpak-glib-backports.c
index c4c30ad1..27c087e1 100644
--- a/common/flatpak-glib-backports.c
+++ b/common/flatpak-glib-backports.c
@@ -402,7 +402,7 @@ out:
#endif
#if !GLIB_CHECK_VERSION (2, 58, 0)
-/* All this code is backported directly from glib 2.66 */
+/* All this code is backported directly from GLib 2.76.2 except where noted */
typedef struct _GLanguageNamesCache GLanguageNamesCache;
@@ -428,7 +428,7 @@ read_aliases (const gchar *file,
FILE *fp;
char buf[256];
- fp = fopen (file,"r");
+ fp = fopen (file, "re");
if (!fp)
return;
while (fgets (buf, 256, fp))
@@ -475,6 +475,7 @@ read_aliases (const gchar *file,
static char *
unalias_lang (char *lang)
{
+#ifndef G_OS_WIN32
static GHashTable *alias_table = NULL;
char *p;
int i;
@@ -500,6 +501,7 @@ unalias_lang (char *lang)
return lang;
}
}
+#endif
return lang;
}