texlive[58778] Build/source/texk/kpathsea: fix a bug that the "nul"

commits+kakuto at tug.org commits+kakuto at tug.org
Wed Apr 7 00:28:31 CEST 2021


Revision: 58778
          http://tug.org/svn/texlive?view=revision&revision=58778
Author:   kakuto
Date:     2021-04-07 00:28:30 +0200 (Wed, 07 Apr 2021)
Log Message:
-----------
fix a bug that the "nul" device given in a full-path form was not readable (w32 only)

Modified Paths:
--------------
    trunk/Build/source/texk/kpathsea/ChangeLog
    trunk/Build/source/texk/kpathsea/knj.c
    trunk/Build/source/texk/kpathsea/readable.c

Modified: trunk/Build/source/texk/kpathsea/ChangeLog
===================================================================
--- trunk/Build/source/texk/kpathsea/ChangeLog	2021-04-06 22:26:10 UTC (rev 58777)
+++ trunk/Build/source/texk/kpathsea/ChangeLog	2021-04-06 22:28:30 UTC (rev 58778)
@@ -1,3 +1,8 @@
+2021-04-07  Akira Kakuto  <kakuto at 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 at tug.org>
 
 	* TL'21.

Modified: trunk/Build/source/texk/kpathsea/knj.c
===================================================================
--- trunk/Build/source/texk/kpathsea/knj.c	2021-04-06 22:26:10 UTC (rev 58777)
+++ trunk/Build/source/texk/kpathsea/knj.c	2021-04-06 22:28:30 UTC (rev 58778)
@@ -129,10 +129,15 @@
   /./ , /../, \.\, \..\ 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, "./");
     }
     if (!p && len > 2) {
@@ -208,10 +213,15 @@
   /./ , /../, \.\, \..\ 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, "./");
     }
     if (!p && len > 2) {

Modified: trunk/Build/source/texk/kpathsea/readable.c
===================================================================
--- trunk/Build/source/texk/kpathsea/readable.c	2021-04-06 22:26:10 UTC (rev 58777)
+++ trunk/Build/source/texk/kpathsea/readable.c	2021-04-06 22:28:30 UTC (rev 58778)
@@ -53,9 +53,14 @@
   /../, /./, \..\, \.\ 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, "./");
   }
   if (!p && len > 2) {



More information about the tex-live-commits mailing list.