From 6ec627589f8dbc7fac26b65ce3c57689a14dd658 Mon Sep 17 00:00:00 2001 From: manojampalam Date: Tue, 5 Apr 2016 18:35:21 -0700 Subject: [PATCH] Workaround for artifact in latest build --- contrib/win32/win32compat/shell-host.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/win32/win32compat/shell-host.c b/contrib/win32/win32compat/shell-host.c index 1696a19..593bc40 100644 --- a/contrib/win32/win32compat/shell-host.c +++ b/contrib/win32/win32compat/shell-host.c @@ -187,8 +187,11 @@ int wmain(int ac, wchar_t **av) { if ((buf[i] == '\r') || (buf[i] == '\n')) { /* TODO - do a much accurate mapping */ - buf[i] = '\n'; GOTO_CLEANUP_ON_FALSE(WriteFile(pipe_out, buf + i, 1, &wr, NULL)); + if ((buf[i] == '\r') && ((i == rd -1) || (buf[i+1] != '\n'))) { + buf[i] = '\n'; + GOTO_CLEANUP_ON_FALSE(WriteFile(pipe_out, buf + i, 1, &wr, NULL)); + } in_cmd[in_cmd_len] = buf[i]; in_cmd_len++; GOTO_CLEANUP_ON_FALSE(WriteFile(child_pipe_write, in_cmd, in_cmd_len, &wr, NULL));