Received: by mail.netbsd.org (Postfix, from userid 605) id 43F0E84D5A; Wed, 27 Feb 2019 04:10:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id B068C84D54 for ; Wed, 27 Feb 2019 04:10:56 +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 p-KlizEyqxxe for ; Wed, 27 Feb 2019 04:10:56 +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 4460C84CF1 for ; Wed, 27 Feb 2019 04:10:56 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 3EEC2FB16; Wed, 27 Feb 2019 04:10:56 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Wed, 27 Feb 2019 04:10:56 +0000 From: "Robert Elz" Subject: CVS commit: src/bin/sh To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20190227041056.3EEC2FB16@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 Feb 27 04:10:56 UTC 2019 Modified Files: src/bin/sh: expand.c parser.c syntax.h Log Message: Finish the fixes from Feb 4 for handling of random data that matches the internal CTL* chars. The earlier fixes handled CTL* char values in var expansions, but not in various other places they can occur (positional parameters, $@ $* -- even potentially $0 and ~ expansions, as well as byte strings generated from a \u in a $'' string). These should all be correctly handled now. There is a new ISCTL() macro to make the test, rather than using the old BASESYNTAX[c]==CCTL form (which us still a viable alternative) as the new way allows compiler optimisations, and less mem references, so it should be smaller and faster. Also, be sure in all cases to remove any CTLESC (or other) CTL* chars from all strings before they are made available for any external use (there was one case missed - which didn't matter when we weren't bothering to escape the CTL* chars at all.) XXX pullup-8 (will need to be via a patch) along with the Feb 4 fixes. To generate a diff of this commit: cvs rdiff -u -r1.130 -r1.131 src/bin/sh/expand.c cvs rdiff -u -r1.166 -r1.167 src/bin/sh/parser.c cvs rdiff -u -r1.11 -r1.12 src/bin/sh/syntax.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.