From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120870 invoked by alias); 4 Jun 2019 15:06:02 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 120860 invoked by uid 89); 4 Jun 2019 15:06:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=am, a.m, UD:a.m X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Jun 2019 15:05:56 +0000 Received: from [172.16.0.120] (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 5C1651E623; Tue, 4 Jun 2019 11:05:54 -0400 (EDT) Subject: Re: [PATCH] Fix cache dir resolving on Windows To: Eli Zaretskii , orgads@gmail.com Cc: gdb-patches@sourceware.org References: <20190603193716.4861-1-orgads@gmail.com> <837ea1tnpa.fsf@gnu.org> From: Simon Marchi Message-ID: <4b1430a8-e637-6582-238b-e29f5010d7f0@simark.ca> Date: Tue, 04 Jun 2019 15:06:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <837ea1tnpa.fsf@gnu.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-06/txt/msg00062.txt.bz2 On 2019-06-04 10:44 a.m., Eli Zaretskii wrote: >> From: orgads@gmail.com >> Cc: Orgad Shaneh >> Date: Mon, 3 Jun 2019 22:37:16 +0300 >> >> From: Orgad Shaneh >> >> ... when not running from MSYS environment, and HOME is not set. >> --- >> gdb/common/pathstuff.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/gdb/common/pathstuff.c b/gdb/common/pathstuff.c >> index 2b1669a5b9..edb8a1fcda 100644 >> --- a/gdb/common/pathstuff.c >> +++ b/gdb/common/pathstuff.c >> @@ -231,6 +231,10 @@ get_standard_cache_dir () >> #endif >> >> const char *home = getenv ("HOME"); >> +#ifdef _WIN32 >> + if (home == nullptr) >> + home = getenv ("USERPROFILE"); >> +#endif >> if (home != NULL) > > This is against the MS platform recommendations regarding "known > folders", see > > https://docs.microsoft.com/en-us/windows/desktop/shell/knownfolderid > https://docs.microsoft.com/en-us/windows/desktop/shell/csidl > > But maybe we don't care about that. I know that many applications > ported from Unix don't. If it's not too complicated to do The Right Thing (use these and be a good citizen, I would prefer that. But I won't be the one writing the change for Windows and maintaining it, so I won't force it either. Simon