From 2c19a85fcc20bb606bd59803db01453bec03f2bb Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Fri, 29 Jul 2011 14:36:44 +0000 Subject: kpathsea: handle "~username" on Windows, from Akira git-svn-id: svn://tug.org/texlive/trunk@23270 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/kpathsea/ChangeLog | 4 ++++ Build/source/texk/kpathsea/tilde.c | 4 ++++ Build/source/texk/kpathsea/tilde.h | 4 ++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index 11b2f675f69..190c0bffb47 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,7 @@ +2011-07-29 Akira Kakuto + + * tilde.c [WIN32]: Use kpathsea_getpwnam(). + 2011-07-28 Peter Breitenlohner More diffs between TeX Live and W32TeX. diff --git a/Build/source/texk/kpathsea/tilde.c b/Build/source/texk/kpathsea/tilde.c index 13b7b05a35b..fa7ebf96b5f 100644 --- a/Build/source/texk/kpathsea/tilde.c +++ b/Build/source/texk/kpathsea/tilde.c @@ -98,9 +98,13 @@ kpathsea_tilde_expand (kpathsea kpse, string name) strncpy (user, name + 1, c - 1); user[c - 1] = 0; +#if defined(WIN32) && !defined(__MINGW32__) + p = kpathsea_getpwnam (kpse, user); +#else /* We only need the cast here for (deficient) systems which do not declare `getpwnam' in . */ p = (struct passwd *) getpwnam (user); +#endif free (user); /* If no such user, just use `.'. */ diff --git a/Build/source/texk/kpathsea/tilde.h b/Build/source/texk/kpathsea/tilde.h index de95bb31bc6..8f55c1df858 100644 --- a/Build/source/texk/kpathsea/tilde.h +++ b/Build/source/texk/kpathsea/tilde.h @@ -1,6 +1,6 @@ /* tilde.h: declare tilde expander. - Copyright 1993, 2008, 2010 Karl Berry. + Copyright 1993, 2008, 2010, 2011 Karl Berry. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -24,7 +24,7 @@ #ifdef MAKE_KPSE_DLL /* libkpathsea internal only */ /* Replace a leading ~ or ~NAME in FILENAME with getenv ("HOME"), or - getenv ('USERPROFILE") on Windows, or with NAME's home directory, + getenv ("USERPROFILE") on Windows, or with NAME's home directory, respectively. Excise trailing slashes. FILENAME may not be null. */ extern string kpathsea_tilde_expand (kpathsea kpse, string filename); -- cgit v1.2.3