diff options
author | Karl Berry <karl@freefriends.org> | 2020-06-13 00:39:50 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-06-13 00:39:50 +0000 |
commit | 885ca5662c15b02a1fc5504fc9b87797860c8787 (patch) | |
tree | 69cc13a3a26d6ca5c7943ed3cf8bf82f37a271b2 | |
parent | b5384e9512fd85f7bf685324cd55d27f809b33c4 (diff) |
(kpathsea_make_tex): do not emit warning if filename has unusual characters
git-svn-id: svn://tug.org/texlive/trunk@55533 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/kpathsea/ChangeLog | 7 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/tex-make.c | 31 |
2 files changed, 24 insertions, 14 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index 439f26a6032..96b795bb9f8 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,10 @@ +2020-06-12 Karl Berry <karl@freefriends.org> + + * tex-make.c (kpathsea_make_tex): do not emit any warnings for + filenames that we don't like, e.g., [Some Fnt]. Leave it up to + the caller. Suggestion from David Carlisle, + https://tug.org/pipermail/tex-k/2020-June/003214.html + 2020-06-06 Akira Kakuto <kakuto@w32tex.org> * readable.c, knj.c: /../, /./, \..\, \.\ should not exist diff --git a/Build/source/texk/kpathsea/tex-make.c b/Build/source/texk/kpathsea/tex-make.c index 629857a3346..530c6ffe535 100644 --- a/Build/source/texk/kpathsea/tex-make.c +++ b/Build/source/texk/kpathsea/tex-make.c @@ -1,6 +1,6 @@ /* tex-make.c: run external programs to make TeX-related files. - Copyright 1993, 1994, 1995, 1996, 1997, 2008-2013, 2018 Karl Berry. + Copyright 1993, 1994, 1995, 1996, 1997, 2008-2020 Karl Berry. Copyright 1997, 1998, 2001-05 Olaf Weber. This library is free software; you can redistribute it and/or @@ -417,7 +417,11 @@ maketex (kpathsea kpse, kpse_file_format_type format, string* args) /* Create BASE in FORMAT and return the generated filename, or - return NULL. */ + return NULL. We used to emit warnings for names we declined to pass + on to the scripts, but such names are common with system fonts, so + now we are silent (just returning NULL). That is arguably better + behavior anyway. Presumably the caller always reports "font not + found" anyway. */ string kpathsea_make_tex (kpathsea kpse, kpse_file_format_type format, @@ -440,17 +444,18 @@ kpathsea_make_tex (kpathsea kpse, kpse_file_format_type format, int argnum; int i; - /* FIXME - * Check whether the name we were given is likely to be a problem. - * Right now we err on the side of strictness: - * - may not start with a hyphen (fixable in the scripts). - * - allowed are: alphanumeric, underscore, hyphen, period, plus - * ? also allowed DIRSEP, as we can be fed that when creating pk fonts - * No doubt some possibilities were overlooked. - */ + /* Check whether the name we were given is likely to be a problem. + All could be fixed in the scripts and/or invocation, but in + practice our names are simple, so let's err on the side of strictness: + - may not start with a hyphen + - allowed are: alphanumeric, underscore, hyphen, period, plus + - also allowed: DIRSEP, as we can be fed that when creating pk fonts + + For example, system fonts are likely to contain spaces, and + (for filename lookups) be enclosed in square brackets. We don't + want to try calling our mktex* scripts on those. + */ if (base[0] == '-' /* || IS_DIR_SEP(base[0]) */) { - fprintf(stderr, "kpathsea:make_tex: Invalid filename `%s', starts with '%c'\n", - base, base[0]); return NULL; } for (i = 0; base[i]; i++) { @@ -461,8 +466,6 @@ kpathsea_make_tex (kpathsea kpse, kpse_file_format_type format, && base[i] != '.' && !IS_DIR_SEP(base[i])) { - fprintf(stderr, "kpathsea:make_tex: Invalid filename `%s', contains '%c'\n", - base, base[i]); return NULL; } } |