diff --git a/src/detection/os/os_windows.cpp b/src/detection/os/os_windows.cpp index 2dee095a0..7b4c6ea2f 100644 --- a/src/detection/os/os_windows.cpp +++ b/src/detection/os/os_windows.cpp @@ -46,6 +46,8 @@ static const char* getOsNameByWinbrand(FFstrbuf* osName) extern "C" void ffDetectOSImpl(FFOSResult* os, const FFinstance* instance) { + FF_UNUSED(instance); + ffStrbufInit(&os->name); ffStrbufInit(&os->prettyName); ffStrbufInit(&os->id); diff --git a/src/util/platform/FFPlatform_unix.c b/src/util/platform/FFPlatform_unix.c index e8025c49e..aa019acb0 100644 --- a/src/util/platform/FFPlatform_unix.c +++ b/src/util/platform/FFPlatform_unix.c @@ -5,7 +5,6 @@ #include #include #include -#include static void getHomeDir(FFPlatform* platform, const struct passwd* pwd) { @@ -40,7 +39,7 @@ static void getConfigDirs(FFPlatform* platform) ffPlatformPathAddHome(&platform->configDirs, platform, ".config/"); #if defined(__APPLE__) - pathsAddHome(&state->configDirs, state, "/Library/Preferences/"); + ffPlatformPathAddHome(&state->configDirs, platform, "/Library/Preferences/"); #endif ffPlatformPathAddHome(&platform->configDirs, platform, ""); @@ -58,6 +57,11 @@ static void getDataDirs(FFPlatform* platform) { ffPlatformPathAddEnv(&platform->dataDirs, "XDG_DATA_HOME"); ffPlatformPathAddHome(&platform->dataDirs, platform, ".local/share/"); + + #if defined(__APPLE__) + ffPlatformPathAddHome(&platform->dataDirs, platform, "/Library/Application Support/"); + #endif + ffPlatformPathAddHome(&platform->dataDirs, platform, ""); ffPlatformPathAddEnv(&platform->dataDirs, "XDG_DATA_DIRS"); ffPlatformPathAddAbsolute(&platform->dataDirs, FASTFETCH_TARGET_DIR_USR"/local/share/"); @@ -83,6 +87,8 @@ static void getHostName(FFPlatform* platform, const struct utsname* uts) ffStrbufAppendS(&platform->hostName, uts->nodename); } +#ifdef __linux__ +#include static void getDomainName(FFPlatform* platform) { struct addrinfo hints = {0}; @@ -103,6 +109,7 @@ static void getDomainName(FFPlatform* platform) freeaddrinfo(info); } +#endif static void getUserShell(FFPlatform* platform, const struct passwd* pwd) { diff --git a/src/util/platform/FFPlatform_windows.c b/src/util/platform/FFPlatform_windows.c index 6175cb3c2..4f09b89f1 100644 --- a/src/util/platform/FFPlatform_windows.c +++ b/src/util/platform/FFPlatform_windows.c @@ -11,9 +11,9 @@ static void getHomeDir(FFPlatform* platform) PWSTR pPath; if(SUCCEEDED(SHGetKnownFolderPath(&FOLDERID_Profile, KF_FLAG_DEFAULT, NULL, &pPath))) { - ffStrbufSetWS(&platform->home_dir, pPath); - ffStrbufReplaceAllC(&platform->home_dir, '\\', '/'); - ffStrbufEnsureEndsWithC(&platform->home_dir, '/'); + ffStrbufSetWS(&platform->homeDir, pPath); + ffStrbufReplaceAllC(&platform->homeDir, '\\', '/'); + ffStrbufEnsureEndsWithC(&platform->homeDir, '/'); } CoTaskMemFree(pPath); } @@ -23,18 +23,18 @@ static void getCacheDir(FFPlatform* platform) PWSTR pPath; if(SUCCEEDED(SHGetKnownFolderPath(&FOLDERID_LocalAppData, KF_FLAG_DEFAULT, NULL, &pPath))) { - ffStrbufSetWS(&platform->cache_dir, pPath); - ffStrbufReplaceAllC(&platform->cache_dir, '\\', '/'); - ffStrbufEnsureEndsWithC(&platform->cache_dir, '/'); + ffStrbufSetWS(&platform->cacheDir, pPath); + ffStrbufReplaceAllC(&platform->cacheDir, '\\', '/'); + ffStrbufEnsureEndsWithC(&platform->cacheDir, '/'); } else { - ffStrbufAppend(&platform->cache_dir, &platform->home_dir); - ffStrbufAppendS(&platform->cache_dir, "AppData/Local/"); + ffStrbufAppend(&platform->cacheDir, &platform->homeDir); + ffStrbufAppendS(&platform->cacheDir, "AppData/Local/"); } CoTaskMemFree(pPath); - ffStrbufAppendS(&platform->cache_dir, "fastfetch/"); + ffStrbufAppendS(&platform->cacheDir, "fastfetch/"); } static void platformPathAddKnownFolder(FFlist* dirs, REFKNOWNFOLDERID folderId)