diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2021-04-07 05:57:07 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2021-04-07 05:57:07 +0000 |
commit | 0ce2c96caa410a1f39e373fae4a8665c14b4b2ac (patch) | |
tree | 9a8745082b2dc861b69ac6528b7414344918faae /Build | |
parent | 021873e2363f4f43b6b04ad7f933706ebfbcb5e1 (diff) |
forgot to initialize a variable
git-svn-id: svn://tug.org/texlive/trunk@58782 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/kpathsea/knj.c | 32 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/readable.c | 11 |
2 files changed, 35 insertions, 8 deletions
diff --git a/Build/source/texk/kpathsea/knj.c b/Build/source/texk/kpathsea/knj.c index 4cf678483ce..3297dbe3e95 100644 --- a/Build/source/texk/kpathsea/knj.c +++ b/Build/source/texk/kpathsea/knj.c @@ -117,7 +117,7 @@ kpathsea_fsyscp_xfopen (kpathsea kpse, const char *filename, const char *mode) wchar_t *fnamew, modew[4]; int i; unsigned char *fnn; - unsigned char *p; + unsigned char *p = NULL; size_t len; assert(filename && mode); @@ -132,8 +132,16 @@ kpathsea_fsyscp_xfopen (kpathsea kpse, const char *filename, const char *mode) The "nul" device should be excluded. (2021/04/07). */ fnn = xmalloc(len + 10); + if (stricmp(filename + len - 3, "nul") == 0) - p = filename; + p = (unsigned char *)filename; + else if (stricmp(filename + len - 4, "nul:") == 0) + p = (unsigned char *)filename; + else if (stricmp(filename + len - 7, "nul.tex") == 0) + p = (unsigned char *)filename; + else if (stricmp(filename + len - 8, "nul:.tex") == 0) + p = (unsigned char *)filename; + if (!p) { p = strstr(filename, ".\\"); } @@ -164,6 +172,7 @@ kpathsea_fsyscp_xfopen (kpathsea kpse, const char *filename, const char *mode) } else { strcpy (fnn, filename); } + for (p = fnn; *p; p++) { if (*p == '/') *p = '\\'; @@ -201,7 +210,7 @@ kpathsea_fsyscp_fopen (kpathsea kpse, const char *filename, const char *mode) wchar_t *fnamew, modew[4]; int i; unsigned char *fnn; - unsigned char *p; + unsigned char *p = NULL; size_t len; assert(filename && mode); @@ -216,8 +225,16 @@ kpathsea_fsyscp_fopen (kpathsea kpse, const char *filename, const char *mode) The "nul" device should be excluded. (2021/04/07). */ fnn = xmalloc(len + 10); + if (stricmp(filename + len - 3, "nul") == 0) - p = filename; + p = (unsigned char *)filename; + else if (stricmp(filename + len - 4, "nul:") == 0) + p = (unsigned char *)filename; + else if (stricmp(filename + len - 7, "nul.tex") == 0) + p = (unsigned char *)filename; + else if (stricmp(filename + len - 8, "nul:.tex") == 0) + p = (unsigned char *)filename; + if (!p) { p = strstr(filename, ".\\"); } @@ -248,6 +265,7 @@ kpathsea_fsyscp_fopen (kpathsea kpse, const char *filename, const char *mode) } else { strcpy (fnn, filename); } + for (p = fnn; *p; p++) { if (*p == '/') *p = '\\'; @@ -645,8 +663,10 @@ kpathsea_win32_perror(kpathsea kpse, const char *str) { wchar_t *wstr; - if (kpse->File_system_codepage != CP_UTF8) - return perror(str); + if (kpse->File_system_codepage != CP_UTF8) { + perror(str); + return; + } wstr = get_wstring_from_utf8(str, wstr=NULL); _wperror(wstr); diff --git a/Build/source/texk/kpathsea/readable.c b/Build/source/texk/kpathsea/readable.c index c1e1076a1cb..a97c3c7fa05 100644 --- a/Build/source/texk/kpathsea/readable.c +++ b/Build/source/texk/kpathsea/readable.c @@ -42,7 +42,7 @@ READABLE(kpathsea kpse, const_string fn, unsigned int st) { wchar_t *fnw; unsigned char *fnn; - unsigned char *p; + unsigned char *p = NULL; size_t len = strlen(fn); fnn = xmalloc(len + 10); @@ -56,7 +56,14 @@ READABLE(kpathsea kpse, const_string fn, unsigned int st) The "nul" device should be excluded. (2021/04/07). */ if (stricmp(fn + len - 3, "nul") == 0) - p = fn; + p = (unsigned char *)fn; + else if (stricmp(fn + len - 4, "nul:") == 0) + p = (unsigned char *)fn; + else if (stricmp(fn + len - 7, "nul.tex") == 0) + p = (unsigned char *)fn; + else if (stricmp(fn + len - 8, "nul:.tex") == 0) + p = (unsigned char *)fn; + if (!p) { p = strstr(fn, ".\\"); } |