From owner-svn-src-all@FreeBSD.ORG Fri Feb 5 18:17:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E22F4106568B; Fri, 5 Feb 2010 18:17:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1DB58FC20; Fri, 5 Feb 2010 18:17:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o15IHHhS016333; Fri, 5 Feb 2010 18:17:17 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o15IHHce016331; Fri, 5 Feb 2010 18:17:17 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002051817.o15IHHce016331@svn.freebsd.org> From: Xin LI Date: Fri, 5 Feb 2010 18:17:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203531 - head/usr.bin/bc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2010 18:17:18 -0000 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)