From dadaab0a4f2b8d8218228fda1fa20a4611a53613 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 30 Oct 2016 07:29:01 -0300 Subject: [PATCH] test --- src/util.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 19823cc05..a586a7516 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -401,19 +401,27 @@ void PrintExceptionContinue(const std::exception* pex, const char* pszThread) } extern char ASSETCHAINS_SYMBOL[16]; +extern int32_t ASSETCHAINS_SHORTFLAG; boost::filesystem::path GetDefaultDataDir() { namespace fs = boost::filesystem; + char symbol[16]; + if ( ASSETCHAINS_SYMBOL[0] != 0 ) + { + if ( ASSETCHAINS_SHORTFLAG != 0 ) + sprintf(symbol,"-%s",ASSETCHAINS_SYMBOL); + else strcpy(symbol,ASSETCHAINS_SYMBOL); + } else symbol[0] = 0; // Windows < Vista: C:\Documents and Settings\Username\Application Data\Zcash // Windows >= Vista: C:\Users\Username\AppData\Roaming\Zcash // Mac: ~/Library/Application Support/Zcash // Unix: ~/.zcash #ifdef WIN32 // Windows - if ( ASSETCHAINS_SYMBOL[0] == 0 ) + if ( symbol[0] == 0 ) return GetSpecialFolderPath(CSIDL_APPDATA) / "Komodo"; - else return GetSpecialFolderPath(CSIDL_APPDATA) / "Komodo" / ASSETCHAINS_SYMBOL; + else return GetSpecialFolderPath(CSIDL_APPDATA) / "Komodo" / symbol; #else fs::path pathRet; char* pszHome = getenv("HOME"); @@ -425,19 +433,19 @@ boost::filesystem::path GetDefaultDataDir() // Mac pathRet /= "Library/Application Support"; TryCreateDirectory(pathRet); - if ( ASSETCHAINS_SYMBOL[0] == 0 ) + if ( symbol[0] == 0 ) return pathRet / "Komodo"; else { pathRet /= "Komodo"; TryCreateDirectory(pathRet); - return pathRet / ASSETCHAINS_SYMBOL; + return pathRet / symbol; } #else // Unix - if ( ASSETCHAINS_SYMBOL[0] == 0 ) + if ( symbol[0] == 0 ) return pathRet / ".komodo"; - else return pathRet / ".komodo" / ASSETCHAINS_SYMBOL; + else return pathRet / ".komodo" / symbol; #endif #endif }