Fix a bug in previous revision.

The bc(1) program may need to deal with files when it's being run in
interactive mode, so we can not blindly use interactive mode (in turn
use libedit) but need to check if the input source is really the standard
input.

This commit should fix a regression where 'bc -l' would not parse the
mathlib.

Reported by:	trasz
This commit is contained in:
delphij 2010-02-05 18:17:17 +00:00
parent 0ade8a15a8
commit d9a99c8c78

View File

@ -301,7 +301,7 @@ static int
bc_yyinput(char *buf, int maxlen)
{
int num;
if (interactive) {
if (yyin == stdin && interactive) {
const char *bp;
if ((bp = el_gets(el, &num)) == NULL || num == 0)