From f1c49473a36bd5068031f2dca4f8cdc7c5dddb70 Mon Sep 17 00:00:00 2001 From: itchyny Date: Wed, 19 Jul 2023 13:04:19 +0900 Subject: [PATCH] Avoid getpwuid for static linking --- src/util.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/util.c b/src/util.c index 9af5471d..250bdf75 100644 --- a/src/util.c +++ b/src/util.c @@ -28,9 +28,6 @@ extern "C" void *alloca (size_t); # endif #endif -#ifndef WIN32 -#include -#endif #ifdef WIN32 #include @@ -103,11 +100,7 @@ jv get_home() { char *home = getenv("HOME"); if (!home) { #ifndef WIN32 - struct passwd* pwd = getpwuid(getuid()); - if (pwd) - ret = jv_string(pwd->pw_dir); - else - ret = jv_invalid_with_msg(jv_string("Could not find home directory.")); + ret = jv_invalid_with_msg(jv_string("Could not find home directory.")); #else home = getenv("USERPROFILE"); if (!home) {