From 5fb4eafd1aebfd5659d853df8adaae8b16fdccef Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Mon, 19 Jul 2021 22:02:44 -0400 Subject: [PATCH] Prefer ~/.hush/HUSH3 to ~/.komodo/HUSH3 if both exist, unix edition --- src/util.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 7834630ba..a470448bb 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -548,13 +548,21 @@ boost::filesystem::path GetDefaultDataDir() } #else // Unix - fs::path tmppath = pathRet / ".komodo" / symbol; + // New directory :) + fs::path tmppath = pathRet / ".hush" / symbol; + // Always use .hush/HUSH3, if it exists (even if .komodo/HUSH3 exists) if(fs::is_directory(tmppath)) { - // legacy directory, use that for backward compat return tmppath; } else { - // New directory :) - tmppath = pathRet / ".hush" / symbol; + // This is the legacy location + tmppath = pathRet / ".komodo" / symbol; + if(fs::is_directory(tmppath)) { + // existing legacy directory, use that for backward compat + return tmppath; + } else { + // For new clones, use .hush/HUSH3 + tmppath = pathRet / ".hush" / symbol; + } return tmppath; } #endif