From d8f5be6ac3aa199d293193fbba6dfa8c7091caa2 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: Sat, 8 Mar 2014 04:18:43 +0000 Subject: [PATCH] Handle 0x0d0a EOLs in spawn_dbus_daemon() On W32 dbus daemon will print output in text mode, with 0x0d0a EOLs instead of just 0x0a. Be able to handle that. https://bugs.freedesktop.org/show_bug.cgi?id=75863 --- test/dbus-daemon-eavesdrop.c | 2 ++ test/dbus-daemon.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/test/dbus-daemon-eavesdrop.c b/test/dbus-daemon-eavesdrop.c index bc5ba12..a78d888 100644 --- a/test/dbus-daemon-eavesdrop.c +++ b/test/dbus-daemon-eavesdrop.c @@ -151,6 +151,8 @@ spawn_dbus_daemon (gchar *binary, if (newline != NULL) { + if ((newline > address->str) && ('\r' == newline[-1])) + newline -= 1; g_string_truncate (address, newline - address->str); break; } diff --git a/test/dbus-daemon.c b/test/dbus-daemon.c index c883425..4b3b61e 100644 --- a/test/dbus-daemon.c +++ b/test/dbus-daemon.c @@ -119,6 +119,8 @@ spawn_dbus_daemon (gchar *binary, if (newline != NULL) { + if ((newline > address->str) && ('\r' == newline[-1])) + newline -= 1; g_string_truncate (address, newline - address->str); break; } -- 1.8.4