diff options
Diffstat (limited to 'src/user/app/init')
-rw-r--r-- | src/user/app/init/shell.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/user/app/init/shell.c b/src/user/app/init/shell.c index 253acce..e53d7d9 100644 --- a/src/user/app/init/shell.c +++ b/src/user/app/init/shell.c @@ -72,7 +72,7 @@ static void cmd_cat_ls(const char *args, bool ls) { return; } - while (!file->eof) { + while (!feof(file)) { int len = fread(buf, 1, sizeof buf, file); if (len <= 0) break; @@ -135,6 +135,8 @@ void shell_loop(void) { printf("%x$ ", level); readline(buf, 256); + if (feof(stdin)) + _syscall_exit(0); redir = strtrim(strsplit(buf, '>')); cmd = strtrim(buf); args = strtrim(strsplit(cmd, 0)); |