diff options
author | dzwdz | 2023-09-07 00:45:30 +0200 |
---|---|---|
committer | dzwdz | 2023-09-07 00:45:30 +0200 |
commit | cd8143209fa965adbcbdaca1036317969af27846 (patch) | |
tree | a96dd8058914d292e2b513872572ad7fed8ad8fb /src/cmd/shell/shell.c | |
parent | 8f5e8eb284430543c041b650084752a09f201b72 (diff) |
shell: fix endless loop after redirection
Diffstat (limited to 'src/cmd/shell/shell.c')
-rw-r--r-- | src/cmd/shell/shell.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/shell/shell.c b/src/cmd/shell/shell.c index 3f33756..1387e48 100644 --- a/src/cmd/shell/shell.c +++ b/src/cmd/shell/shell.c @@ -115,7 +115,7 @@ void run_args(int argc, char **argv, struct redir *redir) { close(p[1]); for (;;) { long len = _sys_read(p[0], buf, buflen, 0); - if (len < 0) exit(0); + if (len <= 0) exit(0); fwrite(buf, 1, len, f); if (ferror(f)) exit(0); } |