From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 21:58:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 786741065694; Wed, 17 Jun 2009 21:58:32 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65C348FC22; Wed, 17 Jun 2009 21:58:32 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HLwWUw089642; Wed, 17 Jun 2009 21:58:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HLwWE4089640; Wed, 17 Jun 2009 21:58:32 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200906172158.n5HLwWE4089640@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 17 Jun 2009 21:58:32 +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: r194406 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2009 21:58:33 -0000 Author: jilles Date: Wed Jun 17 21:58:32 2009 New Revision: 194406 URL: http://svn.freebsd.org/changeset/base/194406 Log: Properly flush input after an error in backquotes in interactive mode. For parsing an old-style backquote substitution (`...`), a string "file" is used to store the contents of the substitution (with the special backslash processing done). If an error occurs, the shell cleans up all these files (returning to the top level) and flush the top level file. Erroneously, it first flushed the current file and then cleaned up all extra files, so that the top level file (i.e. the terminal) was not flushed. Example (in interactive mode): echo `for` echo This should not be printed Also noticeable in (in interactive mode): echo `(` The old version prints an extraneous prompt. Approved by: ed (mentor) Modified: head/bin/sh/input.c Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Wed Jun 17 21:52:39 2009 (r194405) +++ head/bin/sh/input.c Wed Jun 17 21:58:32 2009 (r194406) @@ -118,9 +118,9 @@ INIT { } RESET { + popallfiles(); if (exception != EXSHELLPROC) parselleft = parsenleft = 0; /* clear input buffer */ - popallfiles(); } SHELLPROC {