SHA256
1
0
forked from pool/hugin
hugin/xdg-data.patch

24 lines
928 B
Diff

# HG changeset patch
# User tmodes
# Date 1658245150 -7200
# Tue Jul 19 17:39:10 2022 +0200
# Node ID edfddc6070ca6d4223d359fb4b38273a5aed2f2d
# Parent 490baa16aae6680792d31316be12a75b50236baa
Fixes crash when environment variable XDG_DATA_HOME is not set
diff -r 490baa16aae6 -r edfddc6070ca src/hugin_base/hugin_utils/utils.cpp
--- a/src/hugin_base/hugin_utils/utils.cpp Thu May 26 18:58:52 2022 +0200
+++ b/src/hugin_base/hugin_utils/utils.cpp Tue Jul 19 17:39:10 2022 +0200
@@ -472,9 +472,9 @@
#else
#ifdef USE_XDG_DIRS
char *xdgDataDir = getenv("XDG_DATA_HOME");
- if (strlen(xdgDataDir) == 0)
+ if (xdgDataDir == NULL || strlen(xdgDataDir) == 0)
{
- // no XDG_DATA_HOME enviroment variable set
+ // no XDG_DATA_HOME enviroment variable set or empty variable
// use $HOME/.local/share instead
const std::string homeDir = GetHomeDir();
if (homeDir.empty())