texlive[58782] Build/source/texk/kpathsea: forgot to initialize a

commits+kakuto at tug.org commits+kakuto at tug.org
Wed Apr 7 07:57:08 CEST 2021


Revision: 58782
          http://tug.org/svn/texlive?view=revision&revision=58782
Author:   kakuto
Date:     2021-04-07 07:57:07 +0200 (Wed, 07 Apr 2021)
Log Message:
-----------
forgot to initialize a variable

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

Modified: trunk/Build/source/texk/kpathsea/knj.c
===================================================================
--- trunk/Build/source/texk/kpathsea/knj.c	2021-04-06 23:48:08 UTC (rev 58781)
+++ trunk/Build/source/texk/kpathsea/knj.c	2021-04-07 05:57:07 UTC (rev 58782)
@@ -117,7 +117,7 @@
     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 @@
   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 @@
     } else {
        strcpy (fnn, filename);
     }
+
     for (p = fnn; *p; p++) {
       if (*p == '/')
          *p = '\\';
@@ -201,7 +210,7 @@
     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 @@
   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 @@
     } else {
        strcpy (fnn, filename);
     }
+
     for (p = fnn; *p; p++) {
       if (*p == '/')
          *p = '\\';
@@ -645,8 +663,10 @@
 {
     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);

Modified: trunk/Build/source/texk/kpathsea/readable.c
===================================================================
--- trunk/Build/source/texk/kpathsea/readable.c	2021-04-06 23:48:08 UTC (rev 58781)
+++ trunk/Build/source/texk/kpathsea/readable.c	2021-04-07 05:57:07 UTC (rev 58782)
@@ -42,7 +42,7 @@
 {
   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 @@
   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, ".\\");
   }



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