summaryrefslogtreecommitdiff
path: root/Build/source/texk
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-01-14 01:23:37 +0000
committerKarl Berry <karl@freefriends.org>2008-01-14 01:23:37 +0000
commit13e12240ca1e2232a10f302e2d030e8eeaa1354b (patch)
tree38d32ed09f94c6b23b6c7201299a915ba425e3dd /Build/source/texk
parent72a8586805bfdecad5305807e1dad56cbee24156 (diff)
make ~ expand to USERPROFILE on Windows
git-svn-id: svn://tug.org/texlive/trunk@6222 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk')
-rw-r--r--Build/source/texk/kpathsea/ChangeLog7
-rw-r--r--Build/source/texk/kpathsea/kpathsea.info178
-rw-r--r--Build/source/texk/kpathsea/kpathsea.texi9
-rw-r--r--Build/source/texk/kpathsea/tilde.c20
-rw-r--r--Build/source/texk/kpathsea/tilde.h14
5 files changed, 120 insertions, 108 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
index 116cbae073b..15aff986899 100644
--- a/Build/source/texk/kpathsea/ChangeLog
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -1,3 +1,10 @@
+2008-01-14 Karl Berry <karl@tug.org>
+
+ * tilde.c (HOMEVAR): new #define; "USERPROFILE" on Windows,
+ "HOME" else.
+ * tilde.h: adjust comments.
+ * kpathsea.texi (Tilde expansion): document this.
+
2008-01-13 Karl Berry <karl@tug.org>
* remote.c-no: remove this stub. Suggestion from Martin.
diff --git a/Build/source/texk/kpathsea/kpathsea.info b/Build/source/texk/kpathsea/kpathsea.info
index 067e63e8037..a50692f7aab 100644
--- a/Build/source/texk/kpathsea/kpathsea.info
+++ b/Build/source/texk/kpathsea/kpathsea.info
@@ -14,7 +14,7 @@ END-INFO-DIR-ENTRY
This file documents the Kpathsea library for path searching.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-2005, 2007 Karl Berry & Olaf Weber.
+2005, 2007, 2008 Karl Berry & Olaf Weber.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
@@ -38,7 +38,7 @@ Kpathsea library
This manual documents how to install and use the Kpathsea library for
filename lookup. It corresponds to version 3.5.6dev, released in
-May 2007.
+January 2008.
* Menu:
@@ -59,7 +59,7 @@ File: kpathsea.info, Node: Introduction, Next: Installation, Prev: Top, Up:
**************
This manual corresponds to version 3.5.6dev of the Kpathsea library,
-released in May 2007.
+released in January 2008.
The library's fundamental purpose is to return a filename from a
list of directories specified by the user, similar to what shells do
@@ -2309,7 +2309,8 @@ File: kpathsea.info, Node: Tilde expansion, Next: Brace expansion, Prev: Vari
---------------------
A leading `~' in a path element is replaced by the value of the
-environment variable `HOME', or `.' if `HOME' is not set.
+environment variable `HOME', or `.' if `HOME' is not set. On Windows,
+the environment variable `USERPROFILE' is checked instead of `HOME'.
A leading `~USER' in a path element is replaced by USER's home
directory from the system `passwd' database.
@@ -3627,7 +3628,7 @@ Index
* .web: Supported file formats.
(line 43)
* / may not be /: Searching overview. (line 13)
-* /, trailing in home directory: Tilde expansion. (line 18)
+* /, trailing in home directory: Tilde expansion. (line 19)
* //: Subdirectory expansion.
(line 6)
* /afs/... , installing into: Installing files. (line 32)
@@ -4306,7 +4307,7 @@ Index
* retrieving TeX: unixtex.ftp. (line 6)
* right-hand side of variable assignments: Config files. (line 44)
* Rokicki, Tom: History. (line 12)
-* root user: Tilde expansion. (line 18)
+* root user: Tilde expansion. (line 19)
* runtime configuration files: Config files. (line 6)
* runtime debugging: Debugging. (line 6)
* Sauter fonts, and dynamic source creation: mktex scripts. (line 6)
@@ -4478,11 +4479,11 @@ Index
* TFMFONTS: Supported file formats.
(line 172)
* tilde expansion: Tilde expansion. (line 6)
-* tilde.c: Tilde expansion. (line 24)
+* tilde.c: Tilde expansion. (line 25)
* time system call: Logging. (line 15)
* tolerance for glyph lookup: Basic glyph lookup. (line 15)
* total disk space: Disk space. (line 6)
-* trailing / in home directory: Tilde expansion. (line 18)
+* trailing / in home directory: Tilde expansion. (line 19)
* trailing colons: Default expansion. (line 6)
* TRFONTS: Supported file formats.
(line 177)
@@ -4515,6 +4516,7 @@ Index
* USE_TEXMFVAR: mktex configuration. (line 122)
* USE_VARTEXFONTS: mktex configuration. (line 112)
* Usenet TeX newsgroup: Mailing lists. (line 29)
+* USERPROFILE, as ~ expansion: Tilde expansion. (line 6)
* varfonts: mktex configuration. (line 106)
* variable expansion: Variable expansion. (line 6)
* variable.c: Variable expansion. (line 32)
@@ -4574,85 +4576,85 @@ Index

Tag Table:
-Node: Top1469
-Node: Introduction2114
-Node: History4092
-Node: Installation8184
-Node: Simple installation8974
-Node: Custom installation12557
-Node: Disk space13731
-Node: Kpathsea application distributions14615
-Node: Changing search paths15730
-Node: Default path features16912
-Node: Default path generation19048
-Node: Running configure20491
-Node: configure shells21542
-Node: configure options22594
-Node: configure environment24101
-Node: configure scenarios25903
-Node: Shared library27489
-Node: Running make28503
-Node: Installing files30550
-Node: Cleaning up32497
-Node: Filename database generation33545
-Node: mktex scripts34112
-Node: mktex configuration35069
-Node: mktex script names40613
-Node: mktex script arguments41711
-Node: Installation testing42601
-Node: Security42965
-Node: TeX directory structure45532
-Node: unixtex.ftp49954
-Node: Electronic distribution51969
-Node: CD-ROM distribution54734
-Node: Other TeX packages55704
-Node: Reporting bugs57000
-Node: Bug checklist57740
-Node: Mailing lists61442
-Node: Debugging62801
-Node: Logging67873
-Node: Common problems69743
-Node: Unable to find files70574
-Node: Slow path searching72985
-Node: Unable to generate fonts74362
-Node: TeX or Metafont failing76871
-Node: Empty Makefiles78749
-Node: XtStrings79979
-Node: dlopen80815
-Node: ShellWidgetClass81633
-Node: Pointer combination warnings83265
-Node: Path searching83654
-Node: Searching overview84301
-Node: Path sources87673
-Node: Config files88744
-Node: Path expansion92144
-Node: Default expansion93093
-Node: Variable expansion95163
-Node: Tilde expansion96566
-Node: Brace expansion97464
-Node: KPSE_DOT expansion98569
-Node: Subdirectory expansion99082
-Node: Filename database101431
-Node: ls-R102745
-Node: Filename aliases105639
-Node: Database format106817
-Node: Invoking kpsewhich107830
-Node: Path searching options108707
-Node: Auxiliary tasks113174
-Node: Standard options114848
-Node: TeX support115168
-Node: Supported file formats116459
-Node: File lookup123607
-Node: Glyph lookup124898
-Node: Basic glyph lookup126025
-Node: Fontmap126904
-Node: Fallback font129521
-Node: Suppressing warnings130486
-Node: Programming131591
-Node: Programming overview132104
-Node: Calling sequence134380
-Node: Program-specific files139409
-Node: Programming with config files140447
-Node: Index141747
+Node: Top1475
+Node: Introduction2124
+Node: History4106
+Node: Installation8198
+Node: Simple installation8988
+Node: Custom installation12571
+Node: Disk space13745
+Node: Kpathsea application distributions14629
+Node: Changing search paths15744
+Node: Default path features16926
+Node: Default path generation19062
+Node: Running configure20505
+Node: configure shells21556
+Node: configure options22608
+Node: configure environment24115
+Node: configure scenarios25917
+Node: Shared library27503
+Node: Running make28517
+Node: Installing files30564
+Node: Cleaning up32511
+Node: Filename database generation33559
+Node: mktex scripts34126
+Node: mktex configuration35083
+Node: mktex script names40627
+Node: mktex script arguments41725
+Node: Installation testing42615
+Node: Security42979
+Node: TeX directory structure45546
+Node: unixtex.ftp49968
+Node: Electronic distribution51983
+Node: CD-ROM distribution54748
+Node: Other TeX packages55718
+Node: Reporting bugs57014
+Node: Bug checklist57754
+Node: Mailing lists61456
+Node: Debugging62815
+Node: Logging67887
+Node: Common problems69757
+Node: Unable to find files70588
+Node: Slow path searching72999
+Node: Unable to generate fonts74376
+Node: TeX or Metafont failing76885
+Node: Empty Makefiles78763
+Node: XtStrings79993
+Node: dlopen80829
+Node: ShellWidgetClass81647
+Node: Pointer combination warnings83279
+Node: Path searching83668
+Node: Searching overview84315
+Node: Path sources87687
+Node: Config files88758
+Node: Path expansion92158
+Node: Default expansion93107
+Node: Variable expansion95177
+Node: Tilde expansion96580
+Node: Brace expansion97560
+Node: KPSE_DOT expansion98665
+Node: Subdirectory expansion99178
+Node: Filename database101527
+Node: ls-R102841
+Node: Filename aliases105735
+Node: Database format106913
+Node: Invoking kpsewhich107926
+Node: Path searching options108803
+Node: Auxiliary tasks113270
+Node: Standard options114944
+Node: TeX support115264
+Node: Supported file formats116555
+Node: File lookup123703
+Node: Glyph lookup124994
+Node: Basic glyph lookup126121
+Node: Fontmap127000
+Node: Fallback font129617
+Node: Suppressing warnings130582
+Node: Programming131687
+Node: Programming overview132200
+Node: Calling sequence134476
+Node: Program-specific files139505
+Node: Programming with config files140543
+Node: Index141843

End Tag Table
diff --git a/Build/source/texk/kpathsea/kpathsea.texi b/Build/source/texk/kpathsea/kpathsea.texi
index efdcb8357e0..afadd5953d8 100644
--- a/Build/source/texk/kpathsea/kpathsea.texi
+++ b/Build/source/texk/kpathsea/kpathsea.texi
@@ -3,7 +3,7 @@
@settitle Kpathsea: A library for path searching
@set version 3.5.6dev
-@set month-year May 2007
+@set month-year January 2008
@c Define new indices for commands, filenames, and options.
@defcodeindex cm
@@ -35,7 +35,7 @@
This file documents the Kpathsea library for path searching.
Copyright @copyright{} 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-2004, 2005, 2007 Karl Berry & Olaf Weber.
+2004, 2005, 2007, 2008 Karl Berry & Olaf Weber.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
@@ -675,8 +675,11 @@ Variable expansion is implemented in the source file
@cindex expansion, tilde
@vindex HOME@r{, as ~ expansion}
+@vindex USERPROFILE@r{, as ~ expansion}
A leading @samp{~} in a path element is replaced by the value of the
-environment variable @code{HOME}, or @file{.} if @code{HOME} is not set.
+environment variable @code{HOME}, or @file{.} if @code{HOME} is not
+set. On Windows, the environment variable @code{USERPROFILE} is
+checked instead of @code{HOME}.
A leading @samp{~@var{user}} in a path element is replaced by
@var{user}'s home directory from the system @file{passwd} database.
diff --git a/Build/source/texk/kpathsea/tilde.c b/Build/source/texk/kpathsea/tilde.c
index b92bfe12e38..7d01533d4fc 100644
--- a/Build/source/texk/kpathsea/tilde.c
+++ b/Build/source/texk/kpathsea/tilde.c
@@ -1,7 +1,7 @@
/* tilde.c: Expand user's home directories.
- Copyright 1997, 98, 2005, Olaf Weber.
- Copyright 1993, 95, 96, 97 Karl Berry.
+ Copyright 1997, 1998, 2005, Olaf Weber.
+ Copyright 1993, 1995, 1996, 1997, 2008 Karl Berry.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -13,11 +13,8 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-*/
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, see <http://www.gnu.org/licenses/>. */
#include <kpathsea/config.h>
@@ -28,6 +25,11 @@
#include <pwd.h>
#endif
+#ifdef WIN32
+#define HOMEVAR "USERPROFILE"
+#else
+#define HOMEVAR "HOME"
+#endif
/* If NAME has a leading ~ or ~user, Unix-style, expand it to the user's
home directory, and return a new malloced string. If no ~, or no
@@ -62,7 +64,7 @@ kpse_tilde_expand P1C(const_string, name)
/* If a bare tilde, return the home directory or `.'. (Very unlikely
that the directory name will do anyone any good, but ... */
} else if (name[1] == 0) {
- home = getenv ("HOME");
+ home = getenv (HOMEVAR);
if (!home) {
home = ".";
}
@@ -72,7 +74,7 @@ kpse_tilde_expand P1C(const_string, name)
Should really check for doubled intermediate slashes, too. */
} else if (IS_DIR_SEP (name[1])) {
unsigned c = 1;
- home = getenv ("HOME");
+ home = getenv (HOMEVAR);
if (!home) {
home = ".";
}
diff --git a/Build/source/texk/kpathsea/tilde.h b/Build/source/texk/kpathsea/tilde.h
index 81550e72ca3..138a151a0ce 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 Karl Berry.
+ Copyright 1993, 2008 Karl Berry.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -12,11 +12,8 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-*/
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, see <http://www.gnu.org/licenses/>. */
#ifndef KPATHSEA_TILDE_H
#define KPATHSEA_TILDE_H
@@ -25,8 +22,9 @@
#include <kpathsea/types.h>
-/* Replace a leading ~ or ~name in FILENAME with getenv ("HOME") or
- name's home directory, respectively. FILENAME may not be null. */
+/* Replace a leading ~ or ~NAME in FILENAME with getenv ("HOME"), or
+ getenv ('USERPROFILE") on Windows, or with NAME's home directory,
+ respectively. Excise trailing slashes. FILENAME may not be null. */
extern string kpse_tilde_expand P1H(const_string filename);