aboutsummaryrefslogtreecommitdiff
path: root/shell/shell_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/shell_common.c')
-rw-r--r--shell/shell_common.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/shell/shell_common.c b/shell/shell_common.c
index efe8828e4..716d3aebb 100644
--- a/shell/shell_common.c
+++ b/shell/shell_common.c
@@ -19,11 +19,7 @@
19#include "libbb.h" 19#include "libbb.h"
20#include "shell_common.h" 20#include "shell_common.h"
21 21
22#if !ENABLE_PLATFORM_MINGW32 || ENABLE_ASH_IGNORE_CR
23const char defifsvar[] ALIGN1 = "IFS= \t\n"; 22const char defifsvar[] ALIGN1 = "IFS= \t\n";
24#else
25const char defifsvar[] ALIGN1 = "IFS= \t\n\r";
26#endif
27const char defoptindvar[] ALIGN1 = "OPTIND=1"; 23const char defoptindvar[] ALIGN1 = "OPTIND=1";
28 24
29/* read builtin */ 25/* read builtin */
@@ -261,10 +257,6 @@ shell_builtin_read(struct builtin_read_params *params)
261 257
262 c = buffer[bufpos]; 258 c = buffer[bufpos];
263#if ENABLE_PLATFORM_MINGW32 259#if ENABLE_PLATFORM_MINGW32
264# if !ENABLE_ASH_IGNORE_CR
265 if (c == '\r')
266 continue;
267# else
268 if (c == '\n') { 260 if (c == '\n') {
269 if (backslash == 2 || (bufpos > 0 && buffer[bufpos - 1] == '\r')) { 261 if (backslash == 2 || (bufpos > 0 && buffer[bufpos - 1] == '\r')) {
270 /* We saw either: 262 /* We saw either:
@@ -279,11 +271,10 @@ shell_builtin_read(struct builtin_read_params *params)
279 * process ?? */ 271 * process ?? */
280 backslash = 0; 272 backslash = 0;
281 } 273 }
282# endif
283#endif 274#endif
284 if (!(read_flags & BUILTIN_READ_RAW)) { 275 if (!(read_flags & BUILTIN_READ_RAW)) {
285 if (backslash) { 276 if (backslash) {
286#if ENABLE_ASH_IGNORE_CR 277#if ENABLE_PLATFORM_MINGW32
287 if (c == '\r') { 278 if (c == '\r') {
288 /* We have BS CR, keep CR for now, might see LF next */ 279 /* We have BS CR, keep CR for now, might see LF next */
289 backslash = 2; 280 backslash = 2;