From 8c0acd85f3b1cb208a6f419188d0546db50c4f56 Mon Sep 17 00:00:00 2001 From: Qijia Liu Date: Mon, 27 Jan 2025 18:43:03 -0500 Subject: [PATCH] disable geteuid on win32 --- src/lib/fcitx-utils/standardpath.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/fcitx-utils/standardpath.cpp b/src/lib/fcitx-utils/standardpath.cpp index 76030c8ae..076cfb7b6 100644 --- a/src/lib/fcitx-utils/standardpath.cpp +++ b/src/lib/fcitx-utils/standardpath.cpp @@ -211,6 +211,7 @@ class StandardPathPrivate { } dir = stringutils::joinPath(home, defaultPath); } else { +#ifndef _WIN32 if (env && strcmp(env, "XDG_RUNTIME_DIR") == 0) { dir = stringutils::joinPath( defaultPath, @@ -221,11 +222,15 @@ class StandardPathPrivate { } } } else { +#endif dir = defaultPath; +#ifndef _WIN32 } +#endif } } +#ifndef _WIN32 if (!dir.empty() && env && strcmp(env, "XDG_RUNTIME_DIR") == 0) { struct stat buf; if (stat(dir.c_str(), &buf) != 0 || buf.st_uid != geteuid() || @@ -233,6 +238,7 @@ class StandardPathPrivate { return {}; } } +#endif return dir; }