aboutsummaryrefslogtreecommitdiff
path: root/shell/shell_common.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-05-22 19:34:45 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-05-22 19:34:45 +0200
commitf5470419404d643070db99d058405b714695b817 (patch)
tree7ed502471976679437b86f2e2cb38c14984f8a1e /shell/shell_common.c
parent0c63299b84513ff995413f820cb5f3d546c0c5d7 (diff)
downloadbusybox-w32-f5470419404d643070db99d058405b714695b817.tar.gz
busybox-w32-f5470419404d643070db99d058405b714695b817.tar.bz2
busybox-w32-f5470419404d643070db99d058405b714695b817.zip
ash,hush: fix SIGCHLD interrupting read builtin
function old new delta readcmd 169 217 +48 shell_builtin_read 1087 1097 +10 localcmd 366 364 -2 builtin_read 197 193 -4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/2 up/down: 58/-6) Total: 52 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/shell_common.c')
-rw-r--r--shell/shell_common.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/shell/shell_common.c b/shell/shell_common.c
index fb86e680f..03b7d0b75 100644
--- a/shell/shell_common.c
+++ b/shell/shell_common.c
@@ -204,15 +204,17 @@ shell_builtin_read(void FAST_FUNC (*setvar)(const char *name, const char *val),
204 c = buffer[bufpos]; 204 c = buffer[bufpos];
205 if (c == '\0') 205 if (c == '\0')
206 continue; 206 continue;
207 if (backslash) { 207 if (!(read_flags & BUILTIN_READ_RAW)) {
208 backslash = 0; 208 if (backslash) {
209 if (c != '\n') 209 backslash = 0;
210 goto put; 210 if (c != '\n')
211 continue; 211 goto put;
212 } 212 continue;
213 if (!(read_flags & BUILTIN_READ_RAW) && c == '\\') { 213 }
214 backslash = 1; 214 if (c == '\\') {
215 continue; 215 backslash = 1;
216 continue;
217 }
216 } 218 }
217 if (c == '\n') 219 if (c == '\n')
218 break; 220 break;