From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by sourceware.org (Postfix) with ESMTPS id D84793858D1E for ; Wed, 20 Apr 2022 17:22:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D84793858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f46.google.com with SMTP id 123-20020a1c1981000000b0038b3616a71aso1691001wmz.4 for ; Wed, 20 Apr 2022 10:22:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=1XL1k812WJ0+EXgZFMmCQUIhIT26W51ZAiz1Tf81e/8=; b=LxIDiDm3qtM+2i90154SSW+TYDWPCqDh3e+oLgeWhvIF96ADuKIcV7o1WAxUjplBgK cTUqYXRV7xZSoQUDbQrvduhClOPocsi0jeFm0qaT/4NamvUzrZl1r4RLm2VEcPPt1dg+ aVKX2SdFT3lW9ZWB3Wsq65ok4RLBaG+a/1KP7Qg3dI336bwNvxQ0Itx9x6Ua0zMQioQ1 9JvONCQ1cWHUliWvmtFgUf6z44FtZfyLyZZIhPhvZAIhJENFEHRXpPdr3IkM9rd1zlhB OE9o+FrC74KBoETC6Nitkk8fwUl/FjTn21IM76dVZ+zYaYRM8zwASvLta44SJJLlEa/B jheA== X-Gm-Message-State: AOAM533fWt+LxM8zfiGZnuAyOmohnvm8pmrn7VJGjUYb6AtLmSRsJ5xg LoshlZubvuVwbxZ8FWnCa64= X-Google-Smtp-Source: ABdhPJyrdvzv4aV4OoalxjvVJHmkRoG+36P295Tocxex3PKRZVbdaCygQg+2MkSvRNTyH4PknQvCKA== X-Received: by 2002:a7b:c205:0:b0:38e:b6b4:ed90 with SMTP id x5-20020a7bc205000000b0038eb6b4ed90mr4808621wmi.51.1650475345675; Wed, 20 Apr 2022 10:22:25 -0700 (PDT) Received: from ?IPV6:2001:8a0:f924:2600:209d:85e2:409e:8726? ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id u5-20020adfed45000000b00207a480e6aasm303934wro.116.2022.04.20.10.22.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Apr 2022 10:22:23 -0700 (PDT) Message-ID: Date: Wed, 20 Apr 2022 18:22:22 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH v2] gdbsupport: add path_join function Content-Language: en-US To: Simon Marchi , Eli Zaretskii Cc: gdb-patches@sourceware.org, simon.marchi@efficios.com References: <20220420002005.226872-1-simon.marchi@polymtl.ca> <834k2oszj1.fsf@gnu.org> <831qxrudo3.fsf@gnu.org> From: Pedro Alves In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2022 17:22:28 -0000 On 2022-04-20 15:45, Simon Marchi wrote: > > The original intent here is to have a slightly smart join function that > avoids the double slash issue (to avoid leading double slashes, as you > pointed out) and also for esthetic reasons, should the paths be printed > to the user. If we do want more, then let's just backport > std::filesystem::path or require C++17, there's no point in > reimplementing std::filesystem::path. I don't think teaching path_join to adding the extra rules for Windows is that complicated, and IMO backporting std::filesystem would be waay overkill. I'm not suggesting that we need to implement the extra logic to handle d:foo right now, only that if we ever need it, it's not complicated. It should just be a few lines of code.