texlive[44657] Build/source/libs/zziplib: fix my mistakes in zziplib

commits+kakuto at tug.org commits+kakuto at tug.org
Wed Jun 21 00:35:36 CEST 2017


Revision: 44657
          http://tug.org/svn/texlive?view=revision&revision=44657
Author:   kakuto
Date:     2017-06-21 00:35:36 +0200 (Wed, 21 Jun 2017)
Log Message:
-----------
fix my mistakes in zziplib

Modified Paths:
--------------
    trunk/Build/source/libs/zziplib/TLpatches/patch-01-binary
    trunk/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-big.c
    trunk/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-mem.c
    trunk/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-mix.c
    trunk/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-zip.c

Modified: trunk/Build/source/libs/zziplib/TLpatches/patch-01-binary
===================================================================
--- trunk/Build/source/libs/zziplib/TLpatches/patch-01-binary	2017-06-20 22:18:21 UTC (rev 44656)
+++ trunk/Build/source/libs/zziplib/TLpatches/patch-01-binary	2017-06-20 22:35:36 UTC (rev 44657)
@@ -1,6 +1,6 @@
 diff -ur zziplib-0.13.66.orig/bins/unzip-mem.c zziplib-0.13.66/bins/unzip-mem.c
 --- zziplib-0.13.66.orig/bins/unzip-mem.c	Mon Apr 24 08:46:28 2017
-+++ zziplib-0.13.66/bins/unzip-mem.c	Wed May 24 21:13:24 2017
++++ zziplib-0.13.66/bins/unzip-mem.c	Wed Jun 21 07:29:46 2017
 @@ -100,7 +100,7 @@
  static void zzip_mem_entry_make(ZZIP_MEM_DISK* disk, 
  				ZZIP_MEM_ENTRY* entry)
@@ -12,30 +12,16 @@
      if (status < EXIT_WARNINGS) status = EXIT_WARNINGS;
 diff -ur zziplib-0.13.66.orig/bins/unzzipcat-big.c zziplib-0.13.66/bins/unzzipcat-big.c
 --- zziplib-0.13.66.orig/bins/unzzipcat-big.c	Mon Apr 24 08:46:28 2017
-+++ zziplib-0.13.66/bins/unzzipcat-big.c	Wed May 24 21:13:24 2017
-@@ -62,6 +62,21 @@
++++ zziplib-0.13.66/bins/unzzipcat-big.c	Wed Jun 21 07:29:46 2017
+@@ -62,7 +62,6 @@
      }
  }
  
-+#if !defined(HAVE_STRNDUP)
-+static char *
-+strndup(char *p, size_t maxlen)
-+{
-+  char *r;
-+  if (!p)
-+    return 0;
-+  r = malloc(maxlen + 1);
-+  if (!r)
-+    return r;
-+  strncpy(r, p, maxlen);
-+  r[maxlen] = '\0';
-+  return r;
-+}
-+#endif
- 
+-
  static FILE* create_fopen(char* name, char* mode, int subdirs)
  {
-@@ -83,7 +98,7 @@
+    if (subdirs)
+@@ -83,7 +82,7 @@
      int argn;
      FILE* disk;
  
@@ -44,7 +30,7 @@
      if (! disk) {
  	perror(argv[1]);
  	return -1;
-@@ -96,7 +111,7 @@
+@@ -96,7 +95,7 @@
  	{
  	    char* name = zzip_entry_strdup_name (entry);
  	    FILE* out = stdout;
@@ -53,7 +39,7 @@
  	    unzzip_cat_file (disk, name, out);
  	    if (extract) fclose(out);
  	    free (name);
-@@ -125,7 +140,7 @@
+@@ -125,7 +124,7 @@
  			   FNM_NOESCAPE|FNM_PATHNAME|FNM_PERIOD))
  	    {
  	        FILE* out = stdout;
@@ -64,31 +50,8 @@
  		break; /* match loop */
 diff -ur zziplib-0.13.66.orig/bins/unzzipcat-mem.c zziplib-0.13.66/bins/unzzipcat-mem.c
 --- zziplib-0.13.66.orig/bins/unzzipcat-mem.c	Mon Apr 24 08:46:28 2017
-+++ zziplib-0.13.66/bins/unzzipcat-mem.c	Wed May 24 21:13:24 2017
-@@ -57,6 +57,22 @@
-     }
- }
- 
-+#if !defined(HAVE_STRNDUP)
-+static char *
-+strndup(char *p, size_t maxlen)
-+{
-+  char *r;
-+  if (!p)
-+    return 0;
-+  r = malloc(maxlen + 1);
-+  if (!r)
-+    return r;
-+  strncpy(r, p, maxlen);
-+  r[maxlen] = '\0';
-+  return r;
-+}
-+#endif
-+
- static FILE* create_fopen(char* name, char* mode, int subdirs)
- {
-    if (subdirs)
-@@ -97,7 +113,7 @@
++++ zziplib-0.13.66/bins/unzzipcat-mem.c	Wed Jun 21 07:29:46 2017
+@@ -97,7 +97,7 @@
  	{
  	    char* name = zzip_mem_entry_to_name (entry);
  	    FILE* out = stdout;
@@ -97,7 +60,7 @@
  	    unzzip_mem_disk_cat_file (disk, name, out);
  	    if (extract) fclose(out);
  	}
-@@ -125,7 +141,7 @@
+@@ -125,7 +125,7 @@
  			   FNM_NOESCAPE|FNM_PATHNAME|FNM_PERIOD))
  	    {
  	        FILE* out = stdout;
@@ -108,7 +71,7 @@
  		break; /* match loop */
 diff -ur zziplib-0.13.66.orig/bins/unzzipcat-mix.c zziplib-0.13.66/bins/unzzipcat-mix.c
 --- zziplib-0.13.66.orig/bins/unzzipcat-mix.c	Mon Apr 24 08:46:28 2017
-+++ zziplib-0.13.66/bins/unzzipcat-mix.c	Wed May 24 21:13:24 2017
++++ zziplib-0.13.66/bins/unzzipcat-mix.c	Wed Jun 21 07:29:46 2017
 @@ -30,7 +30,7 @@
  
  static void unzzip_cat_file(ZZIP_DIR* disk, char* name, FILE* out)
@@ -118,30 +81,7 @@
      if (file) 
      {
  	char buffer[1024]; int len;
-@@ -43,6 +43,22 @@
-     }
- }
- 
-+#if !defined(HAVE_STRNDUP)
-+static char *
-+strndup(char *p, size_t maxlen)
-+{
-+  char *r;
-+  if (!p)
-+    return 0;
-+  r = malloc(maxlen + 1);
-+  if (!r)
-+    return r;
-+  strncpy(r, p, maxlen);
-+  r[maxlen] = '\0';
-+  return r;
-+}
-+#endif
-+
- static FILE* create_fopen(char* name, char* mode, int subdirs)
- {
-    if (subdirs)
-@@ -82,7 +98,7 @@
+@@ -82,7 +82,7 @@
  	{
  	    char* name = entry->d_name;
  	    FILE* out = stdout;
@@ -150,7 +90,7 @@
  	    unzzip_cat_file (disk, name, out);
  	    if (extract) fclose(out);
  	}
-@@ -108,7 +124,7 @@
+@@ -108,7 +108,7 @@
  	             memcpy(mix_name, zip_name, zip_name_len);
  	             mix_name[zip_name_len] = '/';
  	             strcpy(mix_name + zip_name_len + 1, name);
@@ -161,31 +101,8 @@
  		     unzzip_cat_file (disk, mix_name, out);
 diff -ur zziplib-0.13.66.orig/bins/unzzipcat-zip.c zziplib-0.13.66/bins/unzzipcat-zip.c
 --- zziplib-0.13.66.orig/bins/unzzipcat-zip.c	Mon Apr 24 08:46:28 2017
-+++ zziplib-0.13.66/bins/unzzipcat-zip.c	Wed May 24 21:13:24 2017
-@@ -43,6 +43,22 @@
-     }
- }
- 
-+#if !defined(HAVE_STRNDUP)
-+static char *
-+strndup(char *p, size_t maxlen)
-+{
-+  char *r;
-+  if (!p)
-+    return 0;
-+  r = malloc(maxlen + 1);
-+  if (!r)
-+    return r;
-+  strncpy(r, p, maxlen);
-+  r[maxlen] = '\0';
-+  return r;
-+}
-+#endif
-+
- static FILE* create_fopen(char* name, char* mode, int subdirs)
- {
-    if (subdirs)
-@@ -83,7 +99,7 @@
++++ zziplib-0.13.66/bins/unzzipcat-zip.c	Wed Jun 21 07:29:46 2017
+@@ -83,7 +83,7 @@
  	{
  	    char* name = entry.d_name;
  	    FILE* out = stdout;
@@ -194,7 +111,7 @@
  	    unzzip_cat_file (disk, name, out);
  	    if (extract) fclose(out);
  	}
-@@ -100,7 +116,7 @@
+@@ -100,7 +100,7 @@
  			       FNM_NOESCAPE|FNM_PATHNAME|FNM_PERIOD))
  	        {
  	             FILE* out = stdout;

Modified: trunk/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-big.c
===================================================================
--- trunk/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-big.c	2017-06-20 22:18:21 UTC (rev 44656)
+++ trunk/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-big.c	2017-06-20 22:35:36 UTC (rev 44657)
@@ -62,22 +62,6 @@
     }
 }
 
-#if !defined(HAVE_STRNDUP)
-static char *
-strndup(char *p, size_t maxlen)
-{
-  char *r;
-  if (!p)
-    return 0;
-  r = malloc(maxlen + 1);
-  if (!r)
-    return r;
-  strncpy(r, p, maxlen);
-  r[maxlen] = '\0';
-  return r;
-}
-#endif
-
 static FILE* create_fopen(char* name, char* mode, int subdirs)
 {
    if (subdirs)

Modified: trunk/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-mem.c
===================================================================
--- trunk/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-mem.c	2017-06-20 22:18:21 UTC (rev 44656)
+++ trunk/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-mem.c	2017-06-20 22:35:36 UTC (rev 44657)
@@ -57,22 +57,6 @@
     }
 }
 
-#if !defined(HAVE_STRNDUP)
-static char *
-strndup(char *p, size_t maxlen)
-{
-  char *r;
-  if (!p)
-    return 0;
-  r = malloc(maxlen + 1);
-  if (!r)
-    return r;
-  strncpy(r, p, maxlen);
-  r[maxlen] = '\0';
-  return r;
-}
-#endif
-
 static FILE* create_fopen(char* name, char* mode, int subdirs)
 {
    if (subdirs)

Modified: trunk/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-mix.c
===================================================================
--- trunk/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-mix.c	2017-06-20 22:18:21 UTC (rev 44656)
+++ trunk/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-mix.c	2017-06-20 22:35:36 UTC (rev 44657)
@@ -43,22 +43,6 @@
     }
 }
 
-#if !defined(HAVE_STRNDUP)
-static char *
-strndup(char *p, size_t maxlen)
-{
-  char *r;
-  if (!p)
-    return 0;
-  r = malloc(maxlen + 1);
-  if (!r)
-    return r;
-  strncpy(r, p, maxlen);
-  r[maxlen] = '\0';
-  return r;
-}
-#endif
-
 static FILE* create_fopen(char* name, char* mode, int subdirs)
 {
    if (subdirs)

Modified: trunk/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-zip.c
===================================================================
--- trunk/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-zip.c	2017-06-20 22:18:21 UTC (rev 44656)
+++ trunk/Build/source/libs/zziplib/zziplib-src/bins/unzzipcat-zip.c	2017-06-20 22:35:36 UTC (rev 44657)
@@ -43,22 +43,6 @@
     }
 }
 
-#if !defined(HAVE_STRNDUP)
-static char *
-strndup(char *p, size_t maxlen)
-{
-  char *r;
-  if (!p)
-    return 0;
-  r = malloc(maxlen + 1);
-  if (!r)
-    return r;
-  strncpy(r, p, maxlen);
-  r[maxlen] = '\0';
-  return r;
-}
-#endif
-
 static FILE* create_fopen(char* name, char* mode, int subdirs)
 {
    if (subdirs)



More information about the tex-live-commits mailing list