svn commit: r203531 - head/usr.bin/bc

Xin LI delphij at FreeBSD.org
Fri Feb 5 18:17:18 UTC 2010


Author: delphij
Date: Fri Feb  5 18:17:17 2010
New Revision: 203531
URL: http://svn.freebsd.org/changeset/base/203531

Log:
  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

Modified:
  head/usr.bin/bc/scan.l

Modified: head/usr.bin/bc/scan.l
==============================================================================
--- head/usr.bin/bc/scan.l	Fri Feb  5 18:00:24 2010	(r203530)
+++ head/usr.bin/bc/scan.l	Fri Feb  5 18:17:17 2010	(r203531)
@@ -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)


More information about the svn-src-all mailing list