Received: by mail.netbsd.org (Postfix, from userid 605) id 2421984E81; Fri, 5 Aug 2022 20:59:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 53E5884E7F for ; Fri, 5 Aug 2022 20:59:55 +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 6DAYdfrF1dR4 for ; Fri, 5 Aug 2022 20:59:54 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id D617684DB2 for ; Fri, 5 Aug 2022 20:59:54 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id CE622FB1A; Fri, 5 Aug 2022 20:59:54 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Fri, 5 Aug 2022 20:59:54 +0000 From: "Roland Illig" Subject: CVS commit: src/usr.bin/make To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20220805205954.CE622FB1A@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Roland Illig" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: rillig Date: Fri Aug 5 20:59:54 UTC 2022 Modified Files: src/usr.bin/make: var.c Log Message: make: when parsing ':D' or ':U', only copy text if necessary When parsing the expression ${:D any ${uninterpreted} text}, parsing of the ':D' modifier only needs to skip to the next delimiter, there is no need to keep record of the text that has been skipped. In this particular example, there had been an unnecessary memory allocation since the nested expression was not copied to the result buffer. Due to that, the resulting buffer contained " any text", which was not a substring of the text passed to the parser, thereby forcing the memory allocation. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.1026 -r1.1027 src/usr.bin/make/var.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.