Received: by mail.netbsd.org (Postfix, from userid 605) id E524184DB6; Tue, 8 Oct 2019 03:52:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 6585D84D77 for ; Tue, 8 Oct 2019 03:52:45 +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 r9v3F918cNWp for ; Tue, 8 Oct 2019 03:52:45 +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 EE1E584CEA for ; Tue, 8 Oct 2019 03:52:44 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id E2116FBF4; Tue, 8 Oct 2019 03:52:44 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Tue, 8 Oct 2019 03:52:44 +0000 From: "Robert Elz" Subject: CVS commit: src/bin/sh To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20191008035244.E2116FBF4@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: Tue Oct 8 03:52:44 UTC 2019 Modified Files: src/bin/sh: expand.c Log Message: Open code the validity test & copy of the character class name in a bracket expression in a pattern (ie: [[:THISNAME:]]). Previously the code used strspn() to look for invalid chars in the name, and then memcpy(), now we do the test and copy a character at a time. This might, or might not, be faster, but it now correctly handles \ quoted characters in the name (' and " quoting were already dealt with, \ was too in an earlier version, but when the \ handling changes were made, this piece of code broke). Not exactly a vital bug fix (who writes [[:\alpha:]] or similar?) but it should work correctly regardless of how obscure the usage is. Problem noted by Harald van Dijk XXX pullup -9 To generate a diff of this commit: cvs rdiff -u -r1.132 -r1.133 src/bin/sh/expand.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.