[libgxps/wip/nacho/separator] parse-utils: convert back \ separators to / on Windows
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgxps/wip/nacho/separator] parse-utils: convert back \ separators to / on Windows
- Date: Sun, 29 Jan 2017 12:20:29 +0000 (UTC)
commit 59d428ceb905555767eec7ce091db4066f460a43
Author: Ignacio Casal Quinteiro <ignacio casal nice-software com>
Date: Sun Jan 29 13:19:13 2017 +0100
parse-utils: convert back \ separators to / on Windows
https://bugzilla.gnome.org/show_bug.cgi?id=777894
libgxps/gxps-parse-utils.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/libgxps/gxps-parse-utils.c b/libgxps/gxps-parse-utils.c
index 18dff53..95e1ebd 100644
--- a/libgxps/gxps-parse-utils.c
+++ b/libgxps/gxps-parse-utils.c
@@ -418,5 +418,20 @@ gxps_resolve_relative_path (const gchar *source,
g_object_unref (abs_file);
g_object_unref (source_file);
+ /* NOTE: this is a bit of a hack but GFile converts the path separator /
+ * internally to the one used by the platform which on Windows is \\
+ * so we need to convert it back to /
+ */
+#ifdef G_OS_WIN32
+ {
+ gchar *p;
+
+ for (p = target; p != '\0'; p++) {
+ if (*p == '\\')
+ *p = '/';
+ }
+ }
+#endif
+
return retval;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]