summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alla@lysator.liu.se>2002-03-13 05:01:58 +0000
committerAlexander Larsson <alexl@src.gnome.org>2002-03-13 05:01:58 +0000
commit428704a0b6efde1e2dcd9fd04a01ac5cad6c6c17 (patch)
tree1ca0e0000dc7ea77a006d38ce7ef8d9900a204f0
parent3346808702b3c828b82f4b444b796f2bb8cd5c4e (diff)
downloadglib-428704a0b6efde1e2dcd9fd04a01ac5cad6c6c17.tar.gz
glib-428704a0b6efde1e2dcd9fd04a01ac5cad6c6c17.tar.bz2
glib-428704a0b6efde1e2dcd9fd04a01ac5cad6c6c17.zip
Cache getenv("G_BROKEN_FILENAMES") in have_broken_filenames() and use
2002-03-12 Alexander Larsson <alla@lysator.liu.se> * glib/gconvert.c: Cache getenv("G_BROKEN_FILENAMES") in have_broken_filenames() and use instead. Add g_convert_init() that calls have_broken_filenames() * gthread/gthread-impl.c: Have g_thread_init call g_convert_init.
-rw-r--r--ChangeLog9
-rw-r--r--ChangeLog.pre-2-09
-rw-r--r--ChangeLog.pre-2-109
-rw-r--r--ChangeLog.pre-2-129
-rw-r--r--ChangeLog.pre-2-29
-rw-r--r--ChangeLog.pre-2-49
-rw-r--r--ChangeLog.pre-2-69
-rw-r--r--ChangeLog.pre-2-89
-rw-r--r--glib/gconvert.c33
-rw-r--r--gthread/gthread-impl.c2
10 files changed, 105 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 2c89fa3b6..46cf7a475 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2002-03-12 Alexander Larsson <alla@lysator.liu.se>
+
+ * glib/gconvert.c:
+ Cache getenv("G_BROKEN_FILENAMES") in have_broken_filenames() and
+ use instead. Add g_convert_init() that calls have_broken_filenames()
+
+ * gthread/gthread-impl.c:
+ Have g_thread_init call g_convert_init.
+
2002-03-11 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strtod):
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index 2c89fa3b6..46cf7a475 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,12 @@
+2002-03-12 Alexander Larsson <alla@lysator.liu.se>
+
+ * glib/gconvert.c:
+ Cache getenv("G_BROKEN_FILENAMES") in have_broken_filenames() and
+ use instead. Add g_convert_init() that calls have_broken_filenames()
+
+ * gthread/gthread-impl.c:
+ Have g_thread_init call g_convert_init.
+
2002-03-11 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strtod):
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 2c89fa3b6..46cf7a475 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,12 @@
+2002-03-12 Alexander Larsson <alla@lysator.liu.se>
+
+ * glib/gconvert.c:
+ Cache getenv("G_BROKEN_FILENAMES") in have_broken_filenames() and
+ use instead. Add g_convert_init() that calls have_broken_filenames()
+
+ * gthread/gthread-impl.c:
+ Have g_thread_init call g_convert_init.
+
2002-03-11 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strtod):
diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12
index 2c89fa3b6..46cf7a475 100644
--- a/ChangeLog.pre-2-12
+++ b/ChangeLog.pre-2-12
@@ -1,3 +1,12 @@
+2002-03-12 Alexander Larsson <alla@lysator.liu.se>
+
+ * glib/gconvert.c:
+ Cache getenv("G_BROKEN_FILENAMES") in have_broken_filenames() and
+ use instead. Add g_convert_init() that calls have_broken_filenames()
+
+ * gthread/gthread-impl.c:
+ Have g_thread_init call g_convert_init.
+
2002-03-11 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strtod):
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index 2c89fa3b6..46cf7a475 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,12 @@
+2002-03-12 Alexander Larsson <alla@lysator.liu.se>
+
+ * glib/gconvert.c:
+ Cache getenv("G_BROKEN_FILENAMES") in have_broken_filenames() and
+ use instead. Add g_convert_init() that calls have_broken_filenames()
+
+ * gthread/gthread-impl.c:
+ Have g_thread_init call g_convert_init.
+
2002-03-11 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strtod):
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index 2c89fa3b6..46cf7a475 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,12 @@
+2002-03-12 Alexander Larsson <alla@lysator.liu.se>
+
+ * glib/gconvert.c:
+ Cache getenv("G_BROKEN_FILENAMES") in have_broken_filenames() and
+ use instead. Add g_convert_init() that calls have_broken_filenames()
+
+ * gthread/gthread-impl.c:
+ Have g_thread_init call g_convert_init.
+
2002-03-11 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strtod):
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index 2c89fa3b6..46cf7a475 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,12 @@
+2002-03-12 Alexander Larsson <alla@lysator.liu.se>
+
+ * glib/gconvert.c:
+ Cache getenv("G_BROKEN_FILENAMES") in have_broken_filenames() and
+ use instead. Add g_convert_init() that calls have_broken_filenames()
+
+ * gthread/gthread-impl.c:
+ Have g_thread_init call g_convert_init.
+
2002-03-11 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strtod):
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 2c89fa3b6..46cf7a475 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,12 @@
+2002-03-12 Alexander Larsson <alla@lysator.liu.se>
+
+ * glib/gconvert.c:
+ Cache getenv("G_BROKEN_FILENAMES") in have_broken_filenames() and
+ use instead. Add g_convert_init() that calls have_broken_filenames()
+
+ * gthread/gthread-impl.c:
+ Have g_thread_init call g_convert_init.
+
2002-03-11 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strtod):
diff --git a/glib/gconvert.c b/glib/gconvert.c
index 9ecb8bed0..bec69f4ba 100644
--- a/glib/gconvert.c
+++ b/glib/gconvert.c
@@ -1189,6 +1189,35 @@ g_locale_from_utf8 (const gchar *utf8string,
#endif /* !G_PLATFORM_WIN32 */
}
+#ifndef G_PLATFORM_WIN32
+static gboolean
+have_broken_filenames (void)
+{
+ static gboolean initialized = FALSE;
+ static gboolean broken;
+
+ if (initialized)
+ return broken;
+
+ broken = (getenv ("G_BROKEN_FILENAMES") != NULL);
+
+ initialized = TRUE;
+
+ return broken;
+}
+#endif /* !G_PLATFORM_WIN32 */
+
+/* This is called from g_thread_init(). It's used to
+ * initialize some static data in a threadsafe way.
+ */
+void
+g_convert_init (void)
+{
+#ifndef G_PLATFORM_WIN32
+ (void)have_broken_filenames ();
+#endif /* !G_PLATFORM_WIN32 */
+}
+
/**
* g_filename_to_utf8:
* @opsysstring: a string in the encoding for filenames
@@ -1225,7 +1254,7 @@ g_filename_to_utf8 (const gchar *opsysstring,
error);
#else /* !G_PLATFORM_WIN32 */
- if (getenv ("G_BROKEN_FILENAMES"))
+ if (have_broken_filenames ())
return g_locale_to_utf8 (opsysstring, len,
bytes_read, bytes_written,
error);
@@ -1268,7 +1297,7 @@ g_filename_from_utf8 (const gchar *utf8string,
bytes_read, bytes_written,
error);
#else /* !G_PLATFORM_WIN32 */
- if (getenv ("G_BROKEN_FILENAMES"))
+ if (have_broken_filenames ())
return g_locale_from_utf8 (utf8string, len,
bytes_read, bytes_written,
error);
diff --git a/gthread/gthread-impl.c b/gthread/gthread-impl.c
index ef79584b3..ed44d2a66 100644
--- a/gthread/gthread-impl.c
+++ b/gthread/gthread-impl.c
@@ -65,6 +65,7 @@ static gint g_thread_priority_map [G_THREAD_PRIORITY_URGENT + 1];
void g_mutex_init (void);
void g_mem_init (void);
void g_messages_init (void);
+void g_convert_init (void);
#define G_MUTEX_DEBUG_INFO(mutex) (*((gpointer*)(((char*)mutex)+G_MUTEX_SIZE)))
@@ -379,6 +380,7 @@ g_thread_init (GThreadFunctions* init)
g_mutex_init ();
g_mem_init ();
g_messages_init ();
+ g_convert_init ();
/* now we can set g_threads_got_initialized and thus enable
* all the thread functions