From d9a99c8c78f1ace45039a3b3364f8d9fad173517 Mon Sep 17 00:00:00 2001 From: delphij Date: Fri, 5 Feb 2010 18:17:17 +0000 Subject: 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(-) (limited to 'usr.bin/bc/scan.l') 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) -- cgit v1.1