aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2012-02-16 16:14:00 +0000
committerRon Yorston <rmy@pobox.com>2012-02-16 16:14:00 +0000
commit6a798baff737501dfeda782af0e79024de1ad491 (patch)
tree6633a35d7de6052da39677c53b35def6c884824c
parentd5891f95ce623434e9b479e1da6f10213d3ecd76 (diff)
downloadbusybox-w32-6a798baff737501dfeda782af0e79024de1ad491.tar.gz
busybox-w32-6a798baff737501dfeda782af0e79024de1ad491.tar.bz2
busybox-w32-6a798baff737501dfeda782af0e79024de1ad491.zip
Eat trailing CRs as well as LFs when expanding backquotes
-rw-r--r--shell/ash.c3
1 files changed, 2 insertions, 1 deletions
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)
6242 6242
6243 /* Eat all trailing newlines */ 6243 /* Eat all trailing newlines */
6244 dest = expdest; 6244 dest = expdest;
6245 for (; dest > (char *)stackblock() && dest[-1] == '\n';) 6245 for (; dest > (char *)stackblock() && (dest[-1] == '\n' ||
6246 (ENABLE_PLATFORM_MINGW32 && dest[-1] == '\r'));)
6246 STUNPUTC(dest); 6247 STUNPUTC(dest);
6247 expdest = dest; 6248 expdest = dest;
6248 6249