From 9a09c0bfc5956ed57fa4c26f84babb6778fa8a34 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Tue, 1 Sep 2026 07:58:49 +0000 Subject: path --- src/main.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/main.cc') diff --git a/src/main.cc b/src/main.cc index f983590..2132ccb 100644 --- a/src/main.cc +++ b/src/main.cc @@ -18,7 +18,6 @@ using namespace std; using namespace ov4; /* Global variables */ -char prompt[] = "$ "; /* command line prompt (DO NOT CHANGE) */ char sbuf[MAXLINE]; /* for composing sprintf messages */ /* @@ -31,7 +30,6 @@ int main(int argc, char **argv) char c; char cmdline[MAXLINE]; - int emit_prompt = 1; /* emit prompt (default) */ /* Redirect stderr to stdout (so that driver will get all output * on the pipe connected to stdout) */ @@ -54,8 +52,6 @@ int main(int argc, char **argv) } } - /* Install the signal handlers */ - /* This one provides a clean way to kill the shell */ @@ -68,10 +64,8 @@ int main(int argc, char **argv) while (1) { /* Read command line */ - if (emit_prompt) { - printf("%s", prompt); - fflush(stdout); - } + print_prompt(); + if ((fgets(cmdline, MAXLINE, stdin) == NULL) && ferror(stdin)) app_error("fgets error"); if (feof(stdin)) { /* End of file (ctrl-d) */ -- cgit v1.3.1-4-g156e