From 10695d3d3472bb5ad7b9f5d9313f073fc67a8f1a Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Mon, 18 May 2015 13:17:02 +0100 Subject: mingw: implement getpwnam (but only for current user) This allows the shell to expand ~user. --- win32/mingw.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'win32') diff --git a/win32/mingw.c b/win32/mingw.c index 514d00692..5847e0fa0 100644 --- a/win32/mingw.c +++ b/win32/mingw.c @@ -603,6 +603,18 @@ static char *get_user_name(void) return user_name; } +struct passwd *getpwnam(const char *name) +{ + const char *myname; + + if ( (myname=get_user_name()) != NULL && + strcmp(myname, name) == 0 ) { + return getpwuid(DEFAULT_UID); + } + + return NULL; +} + struct passwd *getpwuid(uid_t uid UNUSED_PARAM) { static struct passwd p; -- cgit v1.2.3-55-g6feb