From 6a798baff737501dfeda782af0e79024de1ad491 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Thu, 16 Feb 2012 16:14:00 +0000 Subject: Eat trailing CRs as well as LFs when expanding backquotes --- shell/ash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shell/ash.c b/shell/ash.c index fedf86002..93c582f73 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -6242,7 +6242,8 @@ expbackq(union node *cmd, int quoted, int quotes) /* Eat all trailing newlines */ dest = expdest; - for (; dest > (char *)stackblock() && dest[-1] == '\n';) + for (; dest > (char *)stackblock() && (dest[-1] == '\n' || + (ENABLE_PLATFORM_MINGW32 && dest[-1] == '\r'));) STUNPUTC(dest); expdest = dest; -- cgit v1.2.3-55-g6feb