From 07934bd566f6b2bb31d26bbac05f6b569351951e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= Date: Fri, 8 Feb 2019 20:27:23 +0000 Subject: [PATCH] Use OS-dependent separator for G_RESOURCE_OVERLAYS G_RESOURCE_OVERLAYS is a list of resource-path and filesystem-path pairs. Since on Windows filesystem paths use ':', this list can't be ':'-separated there. Fix that by making it ';'-separated on Windows. Make the parser error clearer (we're not looking for a slash, we're looking for an absolute path). (cherry picked from commit 06bbfccc8e36d3919c84d5aae9048677a39a40c7) --- gio/gresource.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gio/gresource.c b/gio/gresource.c index bf54f1d787..fb03068a69 100644 --- a/gio/gresource.c +++ b/gio/gresource.c @@ -151,7 +151,7 @@ G_DEFINE_BOXED_TYPE (GResource, g_resource, g_resource_ref, g_resource_unref) * When debugging a program or testing a change to an installed version, it is often useful to be able to * replace resources in the program or library, without recompiling, for debugging or quick hacking and testing * purposes. Since GLib 2.50, it is possible to use the `G_RESOURCE_OVERLAYS` environment variable to selectively overlay - * resources with replacements from the filesystem. It is a colon-separated list of substitutions to perform + * resources with replacements from the filesystem. It is a %G_SEARCHPATH_SEPARATOR-separated list of substitutions to perform * during resource lookups. * * A substitution has the form @@ -311,7 +311,7 @@ g_resource_find_overlay (const gchar *path, gchar **parts; gint i, j; - parts = g_strsplit (envvar, ":", 0); + parts = g_strsplit (envvar, G_SEARCHPATH_SEPARATOR_S, 0); /* Sanity check the parts, dropping those that are invalid. * 'i' may grow faster than 'j'. @@ -357,9 +357,9 @@ g_resource_find_overlay (const gchar *path, continue; } - if (eq[1] != '/') + if (!g_path_is_absolute (eq + 1)) { - g_critical ("G_RESOURCE_OVERLAYS segment '%s' lacks leading '/' after '='. Ignoring", part); + g_critical ("G_RESOURCE_OVERLAYS segment '%s' does not have an absolute path after '='. Ignoring", part); g_free (part); continue; } -- GitLab