diff options
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, "./"); } |