From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 1mwIDtl59180FAAAWB0awg (envelope-from ) for ; Thu, 07 Jan 2021 16:15:05 -0500 Received: by simark.ca (Postfix, from userid 112) id 2B97C1E965; Thu, 7 Jan 2021 16:15:05 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 3D2711E590 for ; Thu, 7 Jan 2021 16:15:04 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A3CA23973040; Thu, 7 Jan 2021 21:15:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A3CA23973040 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1610054103; bh=gwXVX8yR2VVftN/SezT1Kbf+pgQ8vhBTNJW2zlzHJz8=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Vv65PP/rcTJcWBdFXzThRJPJ24+OaRsfQtK/d6+M3rnuBQuvNzSF76jZ0vISGX2Wt PeUGb1nuHlu9f/A2NrklUChY9vm7as7wbO2as01MnT7lFexFctBUj40e/x286v9qup l5Jg58xFimgapqEvCrM0i+kfJq1G5kueev7KqMxE= Received: from mail.efficios.com (mail.efficios.com [167.114.26.124]) by sourceware.org (Postfix) with ESMTPS id EB9D4397303A for ; Thu, 7 Jan 2021 21:15:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EB9D4397303A Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 8F2362E25F0; Thu, 7 Jan 2021 16:15:00 -0500 (EST) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id WiH_17UgKykP; Thu, 7 Jan 2021 16:15:00 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 264C92E25ED; Thu, 7 Jan 2021 16:15:00 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 264C92E25ED X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id K8yot3BjigZ2; Thu, 7 Jan 2021 16:15:00 -0500 (EST) Received: from [10.0.0.213] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) by mail.efficios.com (Postfix) with ESMTPSA id 0EB452E25EC; Thu, 7 Jan 2021 16:15:00 -0500 (EST) Subject: Re: [PATCH] gdb: check for empty strings in get_standard_cache_dir/get_standard_config_dir To: Tom Tromey , Simon Marchi via Gdb-patches References: <20210107205725.2010353-1-simon.marchi@efficios.com> <87pn2gv4wh.fsf@tromey.com> Message-ID: <69b9d1e9-ec9c-5bdc-4255-4f59440c0b5f@efficios.com> Date: Thu, 7 Jan 2021 16:14:59 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <87pn2gv4wh.fsf@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: sourcewarebugz@kyber.fi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2021-01-07 4:00 p.m., Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi via Gdb-patches writes: > > Simon> gdb_abspath doesn't handle empty strings, so handle this case in the > Simon> callers. If a variable is defined but empty, I think it's reasonable in > Simon> this case to just ignore it, as if it was not defined. > > Makes sense to me. > > For XDG, I read here: > > https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html > > this: > > All paths set in these environment variables must be absolute. If an > implementation encounters a relative path in any of these variables it > should consider the path invalid and ignore it. > > So I suppose we could go a bit further here. > > Tom > Ok, I can try this as a follow-up patch, check that the path is absolute using the IS_ABSOLUTE_PATH macro. Is a tilde path considered absolute? Like ~/my-cache ~smarchi/my-cache I suppose that it is, since it's just a shortcut for /home/smarchi. Simon