summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea/knj.c
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2020-06-06 05:19:02 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2020-06-06 05:19:02 +0000
commitad28aae19d57ccc65af5d6d303550910d3e1721c (patch)
treeee928c2585ef7098fb000f946c6ec9426b4b361b /Build/source/texk/kpathsea/knj.c
parenta9ac14e77b8114ffc43c677571ee0be52fab7e15 (diff)
/../, /./, \..\, \.\ should not exist in \\?\ form of absolute path.
git-svn-id: svn://tug.org/texlive/trunk@55430 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea/knj.c')
-rw-r--r--Build/source/texk/kpathsea/knj.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/Build/source/texk/kpathsea/knj.c b/Build/source/texk/kpathsea/knj.c
index 147f7e084c7..9440438b0f5 100644
--- a/Build/source/texk/kpathsea/knj.c
+++ b/Build/source/texk/kpathsea/knj.c
@@ -126,15 +126,20 @@ kpathsea_fsyscp_xfopen (kpathsea kpse, const char *filename, const char *mode)
Support very long input path name, longer than _MAX_PATH for
Windows, if it really exists and input name is given in
full-absolute path in a command line.
+ /./ , /../, \.\, \..\ should be excluded. (2020/06/06)
*/
fnn = xmalloc(len + 10);
- if (len > 2 && ((filename[0] == '/' && filename[1] == '/') ||
+ p = strstr(filename, ".\\");
+ if (!p) {
+ p = strstr(filename, "./");
+ }
+ if (!p && len > 2 && ((filename[0] == '/' && filename[1] == '/') ||
(filename[0] == '\\' && filename[1] == '\\' &&
filename[2] != '?'))) {
filename += 2;
strcpy (fnn, "\\\\?\\UNC\\");
strcat (fnn, filename);
- } else if (len > 2 && filename[1] == ':') {
+ } else if (!p && len > 2 && filename[1] == ':') {
strcpy (fnn, "\\\\?\\");
strcat (fnn, filename);
} else {
@@ -186,15 +191,20 @@ kpathsea_fsyscp_fopen (kpathsea kpse, const char *filename, const char *mode)
Support very long input path name, longer than _MAX_PATH for
Windows, if it really exists and input name is given in
full-absolute path in a command line.
+ /./ , /../, \.\, \..\ should be excluded. (2020/06/06)
*/
fnn = xmalloc(len + 10);
- if (len > 2 && ((filename[0] == '/' && filename[1] == '/') ||
+ p = strstr(filename, ".\\");
+ if (!p) {
+ p = strstr(filename, "./");
+ }
+ if (!p && len > 2 && ((filename[0] == '/' && filename[1] == '/') ||
(filename[0] == '\\' && filename[1] == '\\' &&
filename[2] != '?'))) {
filename += 2;
strcpy (fnn, "\\\\?\\UNC\\");
strcat (fnn, filename);
- } else if (len > 2 && filename[1] == ':') {
+ } else if (!p && len > 2 && filename[1] == ':') {
strcpy (fnn, "\\\\?\\");
strcat (fnn, filename);
} else {