Page MenuHome

blender_add_xdg_config_support.patch

blender_add_xdg_config_support.patch

--- a/intern/ghost/intern/GHOST_SystemPathsX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemPathsX11.cpp
@@ -42,6 +42,7 @@
#include <stdio.h> // for fprintf only
#include <cstdlib> // for exit
+#include <cstring> // for strncat
#ifdef PREFIX
static const char *static_path= PREFIX "/share" ;
@@ -65,7 +66,13 @@
const GHOST_TUns8* GHOST_SystemPathsX11::getUserDir() const
{
- return (const GHOST_TUns8 *)getenv("HOME");
+ static const char *xdg_config_home = getenv("XDG_CONFIG_HOME");
+ static const char *xdg_config_fallback = strncat(getenv("HOME"),"/.config",8);
+
+ if (xdg_config_home)
+ return (const GHOST_TUns8 *)xdg_config_home;
+ else
+ return (const GHOST_TUns8 *)xdg_config_fallback;
}
const GHOST_TUns8* GHOST_SystemPathsX11::getBinaryDir() const
--- a/source/blender/blenlib/BLI_path_util.h
+++ b/source/blender/blenlib/BLI_path_util.h
@@ -85,7 +85,7 @@
#define BLENDER_USER_FORMAT "%s/Blender/%s"
#define BLENDER_SYSTEM_FORMAT "%s/Blender/%s"
#else
-#define BLENDER_USER_FORMAT "%s/.blender/%s"
+#define BLENDER_USER_FORMAT "%s/blender/%s"
#define BLENDER_SYSTEM_FORMAT "%s/blender/%s"
#endif

File Metadata

Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
eb/ac/bf8858f7c50330ff4b7a32040902

Event Timeline