Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Feb 2010 18:17:17 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r203531 - head/usr.bin/bc
Message-ID:  <201002051817.o15IHHce016331@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002051817.o15IHHce016331>