summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2011-07-29 14:36:44 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2011-07-29 14:36:44 +0000
commit2c19a85fcc20bb606bd59803db01453bec03f2bb (patch)
tree3a8518b79f4d435679635de8f4580dc6cef6136c
parent599299b8f3cffe1e3759d3f42e2c1425520eabce (diff)
kpathsea: handle "~username" on Windows, from Akira
git-svn-id: svn://tug.org/texlive/trunk@23270 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/kpathsea/ChangeLog4
-rw-r--r--Build/source/texk/kpathsea/tilde.c4
-rw-r--r--Build/source/texk/kpathsea/tilde.h4
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 <kakuto@fuk.kindai.ac.jp>
+
+ * tilde.c [WIN32]: Use kpathsea_getpwnam().
+
2011-07-28 Peter Breitenlohner <peb@mppmu.mpg.de>
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 <pwd.h>. */
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);