Received: by mail.netbsd.org (Postfix, from userid 605) id CBBC985EF4; Sun, 27 Mar 2016 14:39:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 5A92485EE4 for ; Sun, 27 Mar 2016 14:39:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id HxQDtq4Xr1A2 for ; Sun, 27 Mar 2016 14:39:35 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id EED8085EF4 for ; Sun, 27 Mar 2016 14:39:34 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 375FFFBBA; Sun, 27 Mar 2016 14:39:33 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Sun, 27 Mar 2016 10:39:33 -0400 From: "Christos Zoulas" Subject: CVS commit: src/bin/sh To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20160327143933.375FFFBBA@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: "Christos Zoulas" Mail-Followup-To: source-changes-d@NetBSD.org Module Name: src Committed By: christos Date: Sun Mar 27 14:39:33 UTC 2016 Modified Files: src/bin/sh: expand.c parser.c parser.h Log Message: PR bin/50993 - this is a significant rewrite of the way that here documents are processed. Now, when first detected, they are simply read (the only change made to the text is to join lines ended with a \ to the subsequent line, otherwise end marker detection does not work correctly (for here docs with an unquoted endmarker only of course.) This patch also moves the "internal subroutine" for looking for the end marker out of readtoken1() (which had to happen as readtoken1 is no longer reading the here doc when it is needed) - that uses code mostly taken from FreeBSD's sh (thanks!) and along the way results in some restrictions on what the end marker can be being removed. We still do not allow all we should. (from kre@) To generate a diff of this commit: cvs rdiff -u -r1.98 -r1.99 src/bin/sh/expand.c cvs rdiff -u -r1.110 -r1.111 src/bin/sh/parser.c cvs rdiff -u -r1.19 -r1.20 src/bin/sh/parser.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.