diff options
author | Ron Yorston <rmy@pobox.com> | 2023-04-09 10:48:58 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2023-04-09 10:48:58 +0100 |
commit | fa04f2dc766c76f2caa44a4b8429185dde6a66b0 (patch) | |
tree | 5d860da97566c6492c0af7d7d5dfb29e232f93c4 /shell/shell_common.c | |
parent | 99402ca92c77b13bee5181c129db18ecd9bf8938 (diff) | |
download | busybox-w32-fa04f2dc766c76f2caa44a4b8429185dde6a66b0.tar.gz busybox-w32-fa04f2dc766c76f2caa44a4b8429185dde6a66b0.tar.bz2 busybox-w32-fa04f2dc766c76f2caa44a4b8429185dde6a66b0.zip |
ash: remove ASH_IGNORE_CR config option
No further problems with CRLF handling have been reported. Remove
the configuration option that allowed some recent changes to be
turned off.
Also, prevent some WIN32 code from being included in the POSIX
build. The faulty code is from commit 64c8f5f3d (ash: add support
for INT trap).
These changes don't alter the default WIN32 build.
Diffstat (limited to 'shell/shell_common.c')
-rw-r--r-- | shell/shell_common.c | 11 |
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 | ||
23 | const char defifsvar[] ALIGN1 = "IFS= \t\n"; | 22 | const char defifsvar[] ALIGN1 = "IFS= \t\n"; |
24 | #else | ||
25 | const char defifsvar[] ALIGN1 = "IFS= \t\n\r"; | ||
26 | #endif | ||
27 | const char defoptindvar[] ALIGN1 = "OPTIND=1"; | 23 | const 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; |