diff --git a/usr.bin/bc/bc.y b/usr.bin/bc/bc.y index 50ac130b461c..793ad46d7f53 100644 --- a/usr.bin/bc/bc.y +++ b/usr.bin/bc/bc.y @@ -996,7 +996,7 @@ yyerror(const char *s) putchar('\\'); putchar(*p); } - fputs("]pc\n", stdout); + fputs("]ec\n", stdout); free(str); } @@ -1173,7 +1173,8 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - interactive = isatty(STDIN_FILENO); + interactive = isatty(STDIN_FILENO) && isatty(STDOUT_FILENO) && + isatty(STDERR_FILENO); for (i = 0; i < argc; i++) sargv[sargc++] = argv[i];