From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 2E7FF3858D32 for ; Wed, 5 Apr 2023 01:17:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2E7FF3858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [10.0.0.170] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id A50CB1E110; Tue, 4 Apr 2023 21:17:52 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1680657472; bh=+Uq1RtQSQcBQI/fGhqsY2nmEwebLBeH3gb8+yf+kSS0=; h=Date:Subject:To:References:From:In-Reply-To:From; b=m2sKdzGw0BGum456jkdrA4SYdftIfomOl2hk6NyUcCX9j7vN7yDzO31FuglCtpvRO es03CBXpq9iFG4feQUhLwljaUb4hnqWwsYGUZf7zDicpVBt3GstdawkQtbuluXOUQO Kxe4je1mwQjv/BNoh8Q0K9Po2s4xI5lZFyfHMhPQ= Message-ID: <2ea12788-551e-b043-163a-b1063ce53098@simark.ca> Date: Tue, 4 Apr 2023 21:17:51 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH] Use std::string in substitute_path_component Content-Language: fr To: Tom Tromey , gdb-patches@sourceware.org References: <20230404185212.1788207-1-tom@tromey.com> From: Simon Marchi In-Reply-To: <20230404185212.1788207-1-tom@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 4/4/23 14:52, Tom Tromey wrote: > This changes substitute_path_component to use std::string, simplifying > it quite a bit, and allowing for the removal of an xfree as well. Your patch LGTM. But a random thought I had while reading it: the sole user of substitute_path_component is auto_load_expand_dir_vars, which splits the path in components just after that. It would seem much simpler to do the $datadir / $debugdir replacement after the split, by iterating on the vector and checking each element. Anyway, not a big deal. Simon