Sync with OpenBSD.

bc.y: Rev 1.50
- write parse errors to stderr, prompted by Martijn Dekker
- we're only interactive if stdout en stderr are a tty as well as stdin

PR:		234430
Obtained from:	OpenBSD
MFC after:	1 week
This commit is contained in:
nyan 2019-01-12 12:35:02 +00:00
parent 5b54ed3f37
commit 1b85c4178e

View File

@ -996,7 +996,7 @@ yyerror(const char *s)
putchar('\\'); putchar('\\');
putchar(*p); putchar(*p);
} }
fputs("]pc\n", stdout); fputs("]ec\n", stdout);
free(str); free(str);
} }
@ -1173,7 +1173,8 @@ main(int argc, char *argv[])
argc -= optind; argc -= optind;
argv += optind; argv += optind;
interactive = isatty(STDIN_FILENO); interactive = isatty(STDIN_FILENO) && isatty(STDOUT_FILENO) &&
isatty(STDERR_FILENO);
for (i = 0; i < argc; i++) for (i = 0; i < argc; i++)
sargv[sargc++] = argv[i]; sargv[sargc++] = argv[i];