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:
Yoshihiro Takahashi 2019-01-12 12:35:02 +00:00
parent c1bc2f7a02
commit 1da80a2c75

View File

@ -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];