diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2021-04-06 22:28:30 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2021-04-06 22:28:30 +0000 |
commit | 633c545b1d6bd858eab69f8cc7075d3f0368f4ef (patch) | |
tree | 9ead2a25457f1246aab75c428bebf6fc6cfb71e1 /Build | |
parent | 88562e66613d36253d64f1b36833f6c1eccc6df3 (diff) |
fix a bug that the "nul" device given in a full-path form was not readable (w32 only)
git-svn-id: svn://tug.org/texlive/trunk@58778 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/kpathsea/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/knj.c | 14 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/readable.c | 7 |
3 files changed, 23 insertions, 3 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index 85061dc53a5..7db205a7c55 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,8 @@ +2021-04-07 Akira Kakuto <kakuto@w32tex.org> + + * knj.c, readable.c: Fix a bug that the "nul" device given in + a full-path form, such as c:/usr/work/nul was not readable. + 2021-03-23 Karl Berry <karl@tug.org> * TL'21. diff --git a/Build/source/texk/kpathsea/knj.c b/Build/source/texk/kpathsea/knj.c index 6aed564ed9f..4cf678483ce 100644 --- a/Build/source/texk/kpathsea/knj.c +++ b/Build/source/texk/kpathsea/knj.c @@ -129,9 +129,14 @@ kpathsea_fsyscp_xfopen (kpathsea kpse, const char *filename, const char *mode) /./ , /../, \.\, \..\ should be excluded. (2020/06/06) More than one adjacent directory separators should be excluded. (2020/10/24) + The "nul" device should be excluded. (2021/04/07). */ fnn = xmalloc(len + 10); - p = strstr(filename, ".\\"); + if (stricmp(filename + len - 3, "nul") == 0) + p = filename; + if (!p) { + p = strstr(filename, ".\\"); + } if (!p) { p = strstr(filename, "./"); } @@ -208,9 +213,14 @@ kpathsea_fsyscp_fopen (kpathsea kpse, const char *filename, const char *mode) /./ , /../, \.\, \..\ should be excluded. (2020/06/06) More than one adjacent directory separators should be excluded. (2020/10/24) + The "nul" device should be excluded. (2021/04/07). */ fnn = xmalloc(len + 10); - p = strstr(filename, ".\\"); + if (stricmp(filename + len - 3, "nul") == 0) + p = filename; + if (!p) { + p = strstr(filename, ".\\"); + } if (!p) { p = strstr(filename, "./"); } diff --git a/Build/source/texk/kpathsea/readable.c b/Build/source/texk/kpathsea/readable.c index 919bfaa0208..c1e1076a1cb 100644 --- a/Build/source/texk/kpathsea/readable.c +++ b/Build/source/texk/kpathsea/readable.c @@ -53,8 +53,13 @@ READABLE(kpathsea kpse, const_string fn, unsigned int st) /../, /./, \..\, \.\ should be excluded (2020/06/06) More than one adjacent directory separators should be excluded. (2020/10/24) + The "nul" device should be excluded. (2021/04/07). */ - p = strstr(fn, ".\\"); + if (stricmp(fn + len - 3, "nul") == 0) + p = fn; + if (!p) { + p = strstr(fn, ".\\"); + } if (!p) { p = strstr(fn, "./"); } |