texlive[56741] Build/source/texk/kpathsea: More than one directory

commits+kakuto at tug.org commits+kakuto at tug.org
Sat Oct 24 00:18:37 CEST 2020


Revision: 56741
          http://tug.org/svn/texlive?view=revision&revision=56741
Author:   kakuto
Date:     2020-10-24 00:18:37 +0200 (Sat, 24 Oct 2020)
Log Message:
-----------
More than one directory separators in filename+2 should not exist
in \\?\ form of absolute path (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	2020-10-23 21:01:21 UTC (rev 56740)
+++ trunk/Build/source/texk/kpathsea/ChangeLog	2020-10-23 22:18:37 UTC (rev 56741)
@@ -1,3 +1,8 @@
+2020-10-24  Akira Kakuto  <kakuto at w32tex.org>
+
+	* readable.c, knj.c: More than one directory separators in
+	filename+2 should not exist in \\?\ form of absolute path.
+
 2020-08-26  Karl Berry  <karl at tug.org>
 
 	* texmf.cnf (save_size): double to 200,000. Needed with

Modified: trunk/Build/source/texk/kpathsea/knj.c
===================================================================
--- trunk/Build/source/texk/kpathsea/knj.c	2020-10-23 21:01:21 UTC (rev 56740)
+++ trunk/Build/source/texk/kpathsea/knj.c	2020-10-23 22:18:37 UTC (rev 56741)
@@ -127,6 +127,7 @@
   Windows, if it really exists and input name is given in
   full-absolute path in a command line.
   /./ , /../, \.\, \..\ should be excluded. (2020/06/06)
+  More than one directory separators should be excluded. (2020/10/24)
 */
     fnn = xmalloc(len + 10);
     p = strstr(filename, ".\\");
@@ -133,6 +134,18 @@
     if (!p) {
        p = strstr(filename, "./");
     }
+    if (!p && len > 2) {
+       p = strstr(filename + 2, "//");
+    }
+    if (!p && len > 2) {
+       p = strstr(filename + 2, "\\\\");
+    }
+    if (!p && len > 2) {
+       p = strstr(filename + 2, "\\/");
+    }
+    if (!p && len > 2) {
+       p = strstr(filename + 2, "/\\");
+    }
     if (!p && len > 2 && ((filename[0] == '/' && filename[1] == '/') ||
         (filename[0] == '\\' && filename[1] == '\\' &&
          filename[2] != '?'))) {
@@ -192,6 +205,7 @@
   Windows, if it really exists and input name is given in
   full-absolute path in a command line.
   /./ , /../, \.\, \..\ should be excluded. (2020/06/06)
+  More than one directory separators should be excluded. (2020/10/24)
 */
     fnn = xmalloc(len + 10);
     p = strstr(filename, ".\\");
@@ -198,6 +212,18 @@
     if (!p) {
        p = strstr(filename, "./");
     }
+    if (!p && len > 2) {
+       p = strstr(filename + 2, "//");
+    }
+    if (!p && len > 2) {
+       p = strstr(filename + 2, "\\\\");
+    }
+    if (!p && len > 2) {
+       p = strstr(filename + 2, "\\/");
+    }
+    if (!p && len > 2) {
+       p = strstr(filename + 2, "/\\");
+    }
     if (!p && len > 2 && ((filename[0] == '/' && filename[1] == '/') ||
         (filename[0] == '\\' && filename[1] == '\\' &&
          filename[2] != '?'))) {

Modified: trunk/Build/source/texk/kpathsea/readable.c
===================================================================
--- trunk/Build/source/texk/kpathsea/readable.c	2020-10-23 21:01:21 UTC (rev 56740)
+++ trunk/Build/source/texk/kpathsea/readable.c	2020-10-23 22:18:37 UTC (rev 56741)
@@ -51,11 +51,24 @@
   Windows, if it really exists and input name is given in
   full-absolute path in a command line.
   /../, /./, \..\, \.\ should be excluded (2020/06/06)
+  More than one directory separators should be excluded. (2020/10/24)
 */
   p = strstr(fn, ".\\");
   if (!p) {
     p = strstr(fn, "./");
   }
+  if (!p && len > 2) {
+    p = strstr(fn + 2, "//");
+  }
+  if (!p && len > 2) {
+    p = strstr(fn + 2, "\\\\");
+  }
+  if (!p && len > 2) {
+    p = strstr(fn + 2, "\\/");
+  }
+  if (!p && len > 2) {
+    p = strstr(fn + 2, "/\\");
+  }
   if (!p && len > 2 && ((fn[0] == '/' && fn[1] == '/') ||
       (fn[0] == '\\' && fn[1] == '\\' && fn[2] != '?'))) {
     fn += 2;



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