From 8af714e59d16f186fd9173edba4fb2699690947a Mon Sep 17 00:00:00 2001 From: dzwdz Date: Tue, 26 Jul 2022 22:10:20 +0200 Subject: user/libc: make FILE an opaque type --- src/user/app/init/shell.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/user/app/init/shell.c') 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)); -- cgit v1.2.3