diff options
author | delphij <delphij@FreeBSD.org> | 2010-02-05 18:17:17 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2010-02-05 18:17:17 +0000 |
commit | d9a99c8c78f1ace45039a3b3364f8d9fad173517 (patch) | |
tree | 14d51973d8c3f5184083e40d1f5489078180a507 /usr.bin/bc | |
parent | 0ade8a15a868ed1de869e7385a4496287216357d (diff) | |
download | FreeBSD-src-d9a99c8c78f1ace45039a3b3364f8d9fad173517.zip FreeBSD-src-d9a99c8c78f1ace45039a3b3364f8d9fad173517.tar.gz |
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
Diffstat (limited to 'usr.bin/bc')
-rw-r--r-- | usr.bin/bc/scan.l | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/bc/scan.l b/usr.bin/bc/scan.l index 40f8ae6..0de6dc8 100644 --- a/usr.bin/bc/scan.l +++ b/usr.bin/bc/scan.l @@ -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) |