From 89ff1978d647c11521838c1cc7b2074f2ec23d07 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Fri, 5 Feb 2010 18:17:17 +0000 Subject: [PATCH] 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 --- usr.bin/bc/scan.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/bc/scan.l b/usr.bin/bc/scan.l index 40f8ae65560..0de6dc84f56 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)