Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/backend
diff options
context:
space:
mode:
authorHib Eris <hib@hiberis.nl>2009-12-22 20:06:06 (GMT)
committer Carlos Garcia Campos <carlosgc@gnome.org>2009-12-23 12:19:10 (GMT)
commita9f7fe8cd4c9d51e407acafe78d2bc89d3b98f6b (patch)
treeaf5f74da636431dca73b79668b18fdfa08e5fb67 /backend
parentfd7c1a68733c5718b9cb0fdcbed09be1889c1140 (diff)
[windows] Use \r\n as delimiter to split lines on Windows
Fixes bgo#605146.
Diffstat (limited to 'backend')
-rw-r--r--backend/comics/comics-document.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/backend/comics/comics-document.c b/backend/comics/comics-document.c
index 9f657c2..b66f4ce 100644
--- a/backend/comics/comics-document.c
+++ b/backend/comics/comics-document.c
@@ -42,6 +42,16 @@
#include "ev-document-thumbnails.h"
#include "ev-file-helpers.h"
+#ifdef G_OS_WIN32
+/* On windows g_spawn_command_line_sync reads stdout in O_BINARY mode, not in O_TEXT mode.
+ * As a consequence, newlines are in a platform dependent representation (\r\n). This
+ * might be considered a bug in glib.
+ */
+#define EV_EOL "\r\n"
+#else
+#define EV_EOL "\n"
+#endif
+
typedef enum
{
RARLABS,
@@ -414,7 +424,8 @@ comics_document_load (EvDocument *document,
}
/* FIXME: is this safe against filenames containing \n in the archive ? */
- cb_files = g_strsplit (std_out, "\n", 0);
+ cb_files = g_strsplit (std_out, EV_EOL, 0);
+
g_free (std_out);
if (!cb_files) {