texlive[53690] Build/source/texk/dvipdfm-x: remove unnecessary

commits+kakuto at tug.org commits+kakuto at tug.org
Thu Feb 6 10:19:25 CET 2020


Revision: 53690
          http://tug.org/svn/texlive?view=revision&revision=53690
Author:   kakuto
Date:     2020-02-06 10:19:24 +0100 (Thu, 06 Feb 2020)
Log Message:
-----------
remove unnecessary assert() check (from S. Hirata)

Modified Paths:
--------------
    trunk/Build/source/texk/dvipdfm-x/ChangeLog
    trunk/Build/source/texk/dvipdfm-x/pdfobj.c

Modified: trunk/Build/source/texk/dvipdfm-x/ChangeLog
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/ChangeLog	2020-02-06 00:54:44 UTC (rev 53689)
+++ trunk/Build/source/texk/dvipdfm-x/ChangeLog	2020-02-06 09:19:24 UTC (rev 53690)
@@ -1,3 +1,12 @@
+2020-02-06  Shunsaku Hirata  <shunsaku.hirata74 at gmail.com>
+
+	* pdfobj.c: In pdf_new_string(), the supplied string was
+	checked and dvipdfmx aborted when it was NULL. This check
+	is removed since it is actually not necessary. The string is
+	regarded simply as an empty string if it is NULL from now on.
+	See https://tex.stackexchange.com/questions/522794/problem-in-updated-tex-live,
+	although we can't reproduce the problem.
+
 2020-01-24  Akira Kakuto  <kakuto at w32tex.org>
 
 	* dvi.c: Forgot to null-terminate strings in the previous

Modified: trunk/Build/source/texk/dvipdfm-x/pdfobj.c
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/pdfobj.c	2020-02-06 00:54:44 UTC (rev 53689)
+++ trunk/Build/source/texk/dvipdfm-x/pdfobj.c	2020-02-06 09:19:24 UTC (rev 53690)
@@ -1,6 +1,6 @@
 /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
 
-    Copyright (C) 2007-2019 by Jin-Hwan Cho and Shunsaku Hirata,
+    Copyright (C) 2007-2020 by Jin-Hwan Cho and Shunsaku Hirata,
     the dvipdfmx project team.
     
     Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks at kettering.edu>
@@ -938,20 +938,20 @@
   pdf_obj    *result;
   pdf_string *data;
 
-  ASSERT(str);
-
   result = pdf_new_obj(PDF_STRING);
   data   = NEW(1, pdf_string);
   result->data = data;
   data->length = length;
 
-  if (length) {
+  if (str && length > 0) {
     data->string = NEW(length+1, unsigned char);
     memcpy(data->string, str, length);
     /* Shouldn't assume NULL terminated. */
     data->string[length] = '\0';
-  } else
+  } else {
     data->string = NULL;
+    data->length = 0;
+  }
 
   return result;
 }



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