diff options
author | Karl Berry <karl@freefriends.org> | 2014-07-22 17:36:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-07-22 17:36:15 +0000 |
commit | cfc3d4f5c13a237b288087ebcbe5834360036bc7 (patch) | |
tree | 966b36c2ab9d2e099ddd8d2f2a02872e2ca444a1 /Build/source/texk/kpathsea/tex-file.c | |
parent | 3cc8e68d6b8cfd65f73f070069de1bc171084e9d (diff) |
have kpsewhich --help display (for each format) variable names considered, the original path string, and the final expanded path
git-svn-id: svn://tug.org/texlive/trunk@34693 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea/tex-file.c')
-rw-r--r-- | Build/source/texk/kpathsea/tex-file.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/Build/source/texk/kpathsea/tex-file.c b/Build/source/texk/kpathsea/tex-file.c index 323e744c48d..4dcade9f566 100644 --- a/Build/source/texk/kpathsea/tex-file.c +++ b/Build/source/texk/kpathsea/tex-file.c @@ -1,7 +1,7 @@ /* tex-file.c: high-level file searching by format. Copyright 1993, 1994, 1995, 1996, 1997, 2007, 2008, 2009, 2010, 2011 - 2012 Karl Berry. + 2012, 2014 Karl Berry. Copyright 1998-2005 Olaf Weber. This library is free software; you can redistribute it and/or @@ -492,16 +492,29 @@ concatn_with_spaces (const_string str1, ...) } -/* Initialize everything for FORMAT. */ +/* Initialize everything for FORMAT. Return its search path. */ const_string kpathsea_init_format (kpathsea kpse, kpse_file_format_type format) { - string envvar_list; /* only for debug output, set in INIT_FORMAT */ - /* If we get called twice, don't redo all the work. */ - if (FMT_INFO.path) - return FMT_INFO.path; + if (! FMT_INFO.path) { + /* Don't care about the list of variable names. */ + (void) kpathsea_init_format_return_varlist (kpse, format); + } + + return FMT_INFO.path; +} + +/* Initialize everything for FORMAT. Return the list of + environment/config variable names considered, which is not otherwise + saved. Although in principle we could add that list to our format + struct, it seems a waste, since this is only used by kpsewhich --help. */ + +const_string +kpathsea_init_format_return_varlist(kpathsea kpse,kpse_file_format_type format) +{ + string envvar_list; /* only for debug output, set in INIT_FORMAT */ switch (format) { /* We might be able to avoid repeating `gf' or whatever so many @@ -877,7 +890,7 @@ kpathsea_init_format (kpathsea kpse, kpse_file_format_type format) } #endif /* KPSE_DEBUG */ - return FMT_INFO.path; + return envvar_list; } #if defined (KPSE_COMPAT_API) |