From patchwork Fri Jun 7 06:27:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Orgad Shaneh X-Patchwork-Id: 33045 Received: (qmail 117500 invoked by alias); 7 Jun 2019 06:27:29 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 117438 invoked by uid 89); 7 Jun 2019 06:27:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: mail-wm1-f68.google.com Received: from mail-wm1-f68.google.com (HELO mail-wm1-f68.google.com) (209.85.128.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Jun 2019 06:27:28 +0000 Received: by mail-wm1-f68.google.com with SMTP id u8so708463wmm.1 for ; Thu, 06 Jun 2019 23:27:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=upWxmSVpqLQ7zA0P9K/mL7F8Y7QRrZgtW+/BTnSYj2I=; b=Vn4htMvq7/0omouAdnVyeG2F9SSxYsrtkviCgzIdHQKnWldqEnVLiOjqtX3r+qCCRy E45DUawZ2wcVQvY5bkY6zB/Es3eVxCkJzUx2+9+QrknXOdMQMjNCahxLBSp/JByNTrln QPaJvovg46ARL9B+dn+lPdhPZpsKPp3tdW11QOBtpbDY8fUojT2zaXbCutLEqG783OFg XKy7AxirZ0dAlk6ITUB+yIhLN12o/NmYAMVOmkP/47eiAy/KH6JEO3xUPRPDpe0/Y5Yo PFMvu2zRAPNGSecYN65O6KbSOX7jSy7WX0JeLY9/a5XjbiIVnAtOusjOt3ZsX3dkM3H6 U6BQ== Return-Path: Received: from junior.corp.audiocodes.com ([164.138.127.164]) by smtp.gmail.com with ESMTPSA id h90sm2696437wrh.15.2019.06.06.23.27.24 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 06 Jun 2019 23:27:25 -0700 (PDT) From: orgads@gmail.com To: gdb-patches@sourceware.org Cc: Orgad Shaneh Subject: [PATCH] Fix cache dir resolving on Windows Date: Fri, 7 Jun 2019 09:27:19 +0300 Message-Id: <20190607062719.10989-1-orgads@gmail.com> In-Reply-To: <20190603193716.4861-1-orgads@gmail.com> References: <20190603193716.4861-1-orgads@gmail.com> MIME-Version: 1.0 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..59410fb61f 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 ("APPDATA"); +#endif if (home != NULL) { /* Make sure the path is absolute and tilde-expanded. */