aboutsummaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2021-06-06 17:10:10 +0200
committerJan200101 <sentrycraft123@gmail.com>2021-06-06 17:10:10 +0200
commit537994756d80178bdaf25e96968f34d2e144797f (patch)
treea093dfc43a8487c5866808e74e7250a6818cf6e0 /src/config.c
parentdf1df2929646abd77955b80e3ded3574ac005179 (diff)
downloadpolecat-537994756d80178bdaf25e96968f34d2e144797f.tar.gz
polecat-537994756d80178bdaf25e96968f34d2e144797f.zip
fix win env, add proper mocking code to test implementation
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c
index 02889b0..0f514f3 100644
--- a/src/config.c
+++ b/src/config.c
@@ -18,7 +18,6 @@ static void getXDGDir(const char* envvar, const char* homeext, char* config, con
else
{
char* home = getenv("HOME");
- if (!home) home = "";
if (!home)
{
#ifdef _WIN32
@@ -27,6 +26,7 @@ static void getXDGDir(const char* envvar, const char* homeext, char* config, con
#endif
home = "";
}
+ if (!home) home = "";
strncpy(config, home, size);
strncat(config, homeext, size - strlen(config));
}