diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2017-06-20 00:49:02 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2017-06-20 00:49:02 +0000 |
commit | 64cebcd2742bed53c840feebf5b2f33981ba803d (patch) | |
tree | 9480befcce98ca0f5fd4797abc9898af5d1d0b26 /Build/source/libs/zziplib/TLpatches/patch-01-binary | |
parent | b4e9c60b697e1dfc02443ed3baed2aededdf4572 (diff) |
zziplib 0.13.66
git-svn-id: svn://tug.org/texlive/trunk@44647 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/zziplib/TLpatches/patch-01-binary')
-rw-r--r-- | Build/source/libs/zziplib/TLpatches/patch-01-binary | 218 |
1 files changed, 204 insertions, 14 deletions
diff --git a/Build/source/libs/zziplib/TLpatches/patch-01-binary b/Build/source/libs/zziplib/TLpatches/patch-01-binary index 4d528511791..518657f6493 100644 --- a/Build/source/libs/zziplib/TLpatches/patch-01-binary +++ b/Build/source/libs/zziplib/TLpatches/patch-01-binary @@ -1,15 +1,205 @@ -diff -ur zziplib-0.13.62.orig/bins/unzzip.c zziplib-0.13.62/bins/unzzip.c ---- zziplib-0.13.62.orig/bins/unzzip.c 2009-08-23 13:38:22.000000000 +0200 -+++ zziplib-0.13.62/bins/unzzip.c 2014-07-11 09:50:50.000000000 +0200 -@@ -72,7 +72,11 @@ - continue; - } - -+#ifdef _WIN32 -+ output = _open (d.d_name, _O_CREAT | _O_BINARY | _O_RDWR); -+#else - output = creat (d.d_name, 0664); -+#endif - if (output == -1) +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 +@@ -100,7 +100,7 @@ + static void zzip_mem_entry_make(ZZIP_MEM_DISK* disk, + ZZIP_MEM_ENTRY* entry) + { +- FILE* file = fopen (entry->zz_name, "w"); ++ FILE* file = fopen (entry->zz_name, "wb"); + if (file) { zzip_mem_entry_pipe (disk, entry, file); fclose (file); } + perror (entry->zz_name); + 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 @@ + } + } + ++#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 @@ + int argn; + FILE* disk; + +- disk = fopen (argv[1], "r"); ++ disk = fopen (argv[1], "rb"); + if (! disk) { + perror(argv[1]); + return -1; +@@ -96,7 +111,7 @@ + { + char* name = zzip_entry_strdup_name (entry); + FILE* out = stdout; +- if (extract) out = create_fopen(name, "w", 1); ++ if (extract) out = create_fopen(name, "wb", 1); + unzzip_cat_file (disk, name, out); + if (extract) fclose(out); + free (name); +@@ -125,7 +140,7 @@ + FNM_NOESCAPE|FNM_PATHNAME|FNM_PERIOD)) + { + FILE* out = stdout; +- if (extract) out = create_fopen(name, "w", 1); ++ if (extract) out = create_fopen(name, "wb", 1); + unzzip_cat_file (disk, name, out); + if (extract) fclose(out); + 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 @@ + { + char* name = zzip_mem_entry_to_name (entry); + FILE* out = stdout; +- if (extract) out = create_fopen(name, "w", 1); ++ if (extract) out = create_fopen(name, "wb", 1); + unzzip_mem_disk_cat_file (disk, name, out); + if (extract) fclose(out); + } +@@ -125,7 +141,7 @@ + FNM_NOESCAPE|FNM_PATHNAME|FNM_PERIOD)) { - fprintf (stderr, "|output file %s: \n", d.d_name); + FILE* out = stdout; +- if (extract) out = create_fopen(name, "w", 1); ++ if (extract) out = create_fopen(name, "wb", 1); + unzzip_mem_disk_cat_file (disk, name, out); + if (extract) fclose(out); + 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 +@@ -30,7 +30,7 @@ + + static void unzzip_cat_file(ZZIP_DIR* disk, char* name, FILE* out) + { +- ZZIP_FILE* file = zzip_fopen(name, "r"); ++ ZZIP_FILE* file = zzip_fopen(name, "rb"); + 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 @@ + { + char* name = entry->d_name; + FILE* out = stdout; +- if (extract) out = create_fopen(name, "w", 1); ++ if (extract) out = create_fopen(name, "wb", 1); + unzzip_cat_file (disk, name, out); + if (extract) fclose(out); + } +@@ -108,7 +124,7 @@ + memcpy(mix_name, zip_name, zip_name_len); + mix_name[zip_name_len] = '/'; + strcpy(mix_name + zip_name_len + 1, name); +- if (extract) out = create_fopen(name, "w", 1); ++ if (extract) out = create_fopen(name, "wb", 1); + fprintf(stderr, "%s %s -> %s\n", zip_name, name, mix_name); + /* 'test1.zip' 'README' -> 'test1/README' */ + 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 @@ + { + char* name = entry.d_name; + FILE* out = stdout; +- if (extract) out = create_fopen(name, "w", 1); ++ if (extract) out = create_fopen(name, "wb", 1); + unzzip_cat_file (disk, name, out); + if (extract) fclose(out); + } +@@ -100,7 +116,7 @@ + FNM_NOESCAPE|FNM_PATHNAME|FNM_PERIOD)) + { + FILE* out = stdout; +- if (extract) out = create_fopen(name, "w", 1); ++ if (extract) out = create_fopen(name, "wb", 1); + unzzip_cat_file (disk, name, out); + if (extract) fclose(out); + break; /* match loop */ |