diff options
author | Руслан Ижбулатов <lrn1986@gmail.com> | 2014-03-08 04:18:43 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-04-30 19:42:22 +0100 |
commit | 28812c885f0b75fa9b2f6094534b85846fcd2cf4 (patch) | |
tree | 80af18c01a15bf67ffe26f739d06a440d2c8d851 | |
parent | c02ac70566cb9b6af1f17a580ab710578317ae9a (diff) | |
download | dbus-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
-rw-r--r-- | test/dbus-daemon-eavesdrop.c | 2 | ||||
-rw-r--r-- | test/dbus-daemon.c | 2 |
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; } |