diff options
author | Ron Yorston <rmy@pobox.com> | 2012-02-16 16:14:00 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2012-02-16 16:14:00 +0000 |
commit | 6a798baff737501dfeda782af0e79024de1ad491 (patch) | |
tree | 6633a35d7de6052da39677c53b35def6c884824c | |
parent | d5891f95ce623434e9b479e1da6f10213d3ecd76 (diff) | |
download | busybox-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.c | 3 |
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 | ||