diff options
| author | _ov4 <ov4@ov4.org> | 2026-09-01 07:58:49 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-09-01 07:58:49 +0000 |
| commit | 9a09c0bfc5956ed57fa4c26f84babb6778fa8a34 (patch) | |
| tree | 9f11e72fa682dbaad744a4b617500d924e8436e4 /src/main.cc | |
| parent | c1733952f1bbb567b335109f51fb66a73abfedd3 (diff) | |
path
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) */ |
