diff options
Diffstat (limited to 'src/main.cc')
| -rw-r--r-- | src/main.cc | 10 |
1 files changed, 2 insertions, 8 deletions
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) */ |
