Received: by mail.netbsd.org (Postfix, from userid 605) id 5106384D5D; Wed, 9 Jan 2019 10:57:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 96BDD84D5A for ; Wed, 9 Jan 2019 10:57:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id R9c93U9XHZko for ; Wed, 9 Jan 2019 10:57:44 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 1EB3484D20 for ; Wed, 9 Jan 2019 10:57:44 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 18739FB16; Wed, 9 Jan 2019 10:57:44 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Wed, 9 Jan 2019 10:57:44 +0000 From: "Robert Elz" Subject: CVS commit: src/bin/sh To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20190109105744.18739FB16@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: source-changes.NetBSD.org Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Robert Elz" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: kre Date: Wed Jan 9 10:57:44 UTC 2019 Modified Files: src/bin/sh: eval.c Log Message: When an error occurs in a builtin from which we do not exit (a normal builtin, though those are not genrally an issue for this problem, or a special builtin that has been prefixed by "command") make sure that we discard any pending input that might have been queued up, but not yet processed. We had the mechanism to fix this from when expansion of PS1 etc was added (which has a similar problem to deal with) - all taken from FreeBSD - but did not bother to use it here until now... This fixes an error detected by newly added ATF tests of the eval builtin, where eval 'syntax error another command' would go ahead and evaluate "another command" which should not happen (note: only when there was a \n between the two). To generate a diff of this commit: cvs rdiff -u -r1.168 -r1.169 src/bin/sh/eval.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.