Skip to content

Commit

Permalink
Add Snap patch for home folder, otherwise data folder will be deleted…
Browse files Browse the repository at this point in the history
… on each upgrade
  • Loading branch information
slateapps committed Jul 7, 2018
1 parent a62a155 commit addd8c6
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions snap/patches/default_data_dir.patch
@@ -0,0 +1,25 @@
From 9e743715662b6bed2e9df60a061be9cdacf635ee Mon Sep 17 00:00:00 2001
From: Slate Random Dev <slate@i2pmail.org>
Date: Sat, 7 Jul 2018 23:10:50 +0200
Subject: [PATCH 1/2] Snap patch: home dir

---
src/util.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util.cpp b/src/util.cpp
index 223e4fe..5ba3841 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -433,7 +433,7 @@ boost::filesystem::path GetDefaultDataDir()
return GetSpecialFolderPath(CSIDL_APPDATA) / "SLATE";
#else
fs::path pathRet;
- char* pszHome = getenv("HOME");
+ char* pszHome = getenv("SNAP_USER_COMMON");
if (pszHome == NULL || strlen(pszHome) == 0)
pathRet = fs::path("/");
else
--
2.7.4

0 comments on commit addd8c6

Please sign in to comment.