summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorРуслан Ижбулатов <lrn1986@gmail.com>2014-03-08 04:18:43 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-04-30 19:42:22 +0100
commit28812c885f0b75fa9b2f6094534b85846fcd2cf4 (patch)
tree80af18c01a15bf67ffe26f739d06a440d2c8d851 /test
parentc02ac70566cb9b6af1f17a580ab710578317ae9a (diff)
downloaddbus-28812c885f0b75fa9b2f6094534b85846fcd2cf4.tar.gz
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. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=75863 Reviewed-by: Simon McVittie
Diffstat (limited to 'test')
-rw-r--r--test/dbus-daemon-eavesdrop.c2
-rw-r--r--test/dbus-daemon.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/test/dbus-daemon-eavesdrop.c b/test/dbus-daemon-eavesdrop.c
index bc5ba121..a78d8888 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 c883425e..4b3b61e5 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;
}