From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id VWY3KZk8+F9jKQAAWB0awg (envelope-from ) for ; Fri, 08 Jan 2021 06:06:01 -0500 Received: by simark.ca (Postfix, from userid 112) id 95DEB1E99A; Fri, 8 Jan 2021 06:06:01 -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 48ABE1E940; Fri, 8 Jan 2021 06:05:59 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9FB1A3844028; Fri, 8 Jan 2021 11:05:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9FB1A3844028 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1610103958; bh=WRUmgqZA/wTB85idTdq6q3I9U0vSKMZtSPkW7PdLAwU=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=ozqhYnp+WJqCrFkuwFsJqN+G3nXwpG/6w4hTbcR1Y0fmf3i14VkCqr7yL+mfsxwyX QHAXxlzfAX5vXffp5rTxyCyXDbZYx3ze8+955qJLjBSAO2/57uE0nD0kI3xPJNnxTg 0I+96w7Jih4vL8GVbX8SsJh5/h/e9d9uOJ6IWp7w= Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) by sourceware.org (Postfix) with ESMTPS id 952A83844028 for ; Fri, 8 Jan 2021 11:05:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 952A83844028 Received: by mail-qk1-x732.google.com with SMTP id z11so8085497qkj.7 for ; Fri, 08 Jan 2021 03:05:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WRUmgqZA/wTB85idTdq6q3I9U0vSKMZtSPkW7PdLAwU=; b=IcaHbfheEZ7is8fCgiNdPnajH1ZdJCFutV3qb0flnv2gYPiiEND09IVtoqF/SQXIaU +1X7V9H70RNjLrpqAJb5QZLaUp/WhylV9Clu/fNG2Z7nHzGcON6lnqwCO0qbjCPDwUag TUYO1aMi4rmwWV219+Wnv4px1zl9h/6oeGO0D7CiUPBbqJ+IVWgx/yRI2TfcDyuiLGcq TJZi88uz1gkXjxq+ZcEFlEXD2uEJ6Dmbc9/CSJpyU83MR7cDBxPEQZ/qrAWTqHi2zSLB 4WotxQsY5fAJmGR8bnIQSKkTKXHIDfUNTudB1rj1gP9rhN/pYWUtZQLmmCyGRBvPkmCo Noog== X-Gm-Message-State: AOAM533g/lF+4DcHRq57yQFvTzDzdVteM4Y0a2srpmEI2w49ccuPuBo/ PP6thhvxWmjhR4Bv5RYCunIQVcE++tEEEC661e3nZ/rDLk3lV2Lv X-Google-Smtp-Source: ABdhPJydwzJwkJpRAOL934cWwUPEA1xdnFMsrywOOhujmr5lZ/Ac9R67M7zHsdMnDbUI0JFU07+J5pHl69s3V5uCvYk= X-Received: by 2002:a37:9f8d:: with SMTP id i135mr3229808qke.439.1610103955844; Fri, 08 Jan 2021 03:05:55 -0800 (PST) MIME-Version: 1.0 References: <20210107205725.2010353-1-simon.marchi@efficios.com> <87pn2gv4wh.fsf@tromey.com> <69b9d1e9-ec9c-5bdc-4255-4f59440c0b5f@efficios.com> In-Reply-To: <69b9d1e9-ec9c-5bdc-4255-4f59440c0b5f@efficios.com> Date: Fri, 8 Jan 2021 12:05:18 +0100 Message-ID: Subject: Re: [PATCH] gdb: check for empty strings in get_standard_cache_dir/get_standard_config_dir To: Simon Marchi Content-Type: text/plain; charset="UTF-8" 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: Christian Biesinger via Gdb-patches Reply-To: Christian Biesinger Cc: Tom Tromey , Simon Marchi via Gdb-patches , sourcewarebugz@kyber.fi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On Thu, Jan 7, 2021 at 10:15 PM Simon Marchi via Gdb-patches wrote: > > 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 IMO tildes in environment variables are pretty uncommon and often unsupported by tools; usually the shell expands them before setting it. So I don't know if it's worth writing code to support that. Christian