]> granicus.if.org Git - zziplib/commitdiff
use fopen('wb') for output files / patch from TexLive TLpatches/patch-01-binary
authorGuido Draheim <guidod@gmx.de>
Thu, 1 Mar 2018 17:12:44 +0000 (18:12 +0100)
committerGuido Draheim <guidod@gmx.de>
Thu, 1 Mar 2018 17:12:44 +0000 (18:12 +0100)
bins/unzip-mem.c
bins/unzzipcat-big.c
bins/unzzipcat-mem.c
bins/unzzipcat-mix.c
bins/unzzipcat-zip.c
bins/unzzipdir-big.c

index bf104959879900972fcdd378ebe2a421670ac13d..b20bf37d6c577c943948d2e90db494b16947d7eb 100644 (file)
@@ -96,7 +96,7 @@ static void zzip_mem_entry_pipe(ZZIP_MEM_DISK* disk,
 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;
index 0efd878098aa588e9f6480d919ed1b86b8fc040f..7ab6bad9b15f819717600bd1197d06500121c196 100644 (file)
@@ -89,7 +89,7 @@ static int unzzip_cat (int argc, char ** argv, int extract)
     int argn;
     FILE* disk;
 
-    disk = fopen (argv[1], "r");
+    disk = fopen (argv[1], "rb");
     if (! disk) {
        perror(argv[1]);
        return exitcode(errno);
@@ -106,7 +106,7 @@ static int unzzip_cat (int argc, char ** argv, int extract)
                done = EXIT_WARNINGS;
                continue;
            }
-           if (extract) out = create_fopen(name, "w", 1);
+           if (extract) out = create_fopen(name, "wb", 1);
            if (! out) {
                if (errno != EISDIR) done = EXIT_ERRORS;
                continue;
@@ -139,7 +139,7 @@ static int unzzip_cat (int argc, char ** argv, int extract)
                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);
                if (! out) {
                    if (errno != EISDIR) done = EXIT_ERRORS;
                    continue;
index b81c703cc438207eced623dc020cd37317dd36a4..13cca3aaf7b7f49fb1f898fb3ac23a4f782d545d 100644 (file)
@@ -114,7 +114,7 @@ static int unzzip_cat (int argc, char ** argv, int extract)
        {
            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);
            if (! out) {
                if (errno != EISDIR) done = EXIT_ERRORS;
                continue;
@@ -146,7 +146,7 @@ static int unzzip_cat (int argc, char ** argv, int extract)
                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);
                if (! out) {
                    if (errno != EISDIR) done = EXIT_ERRORS;
                    continue;
index 1a6cd4c940af12d4052d4eb4d9af677100041436..aa9b86c4915d61b14093606dd52b3e54f410817f 100644 (file)
@@ -56,7 +56,7 @@ static int exitcode(int e)
 
 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;
@@ -124,7 +124,7 @@ static int unzzip_cat (int argc, char ** argv, int extract)
        {
            char* name = entry->d_name;
            FILE* out = stdout;
-           if (extract) out = create_fopen(name, "w", 1);
+           if (extract) out = create_fopen(name, "wb", 1);
            if (! out) {
                if (errno != EISDIR) done = EXIT_ERRORS;
                continue;
@@ -155,7 +155,7 @@ static int unzzip_cat (int argc, char ** argv, int extract)
                     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);
                     if (! out) {
                         if (errno != EISDIR) done = EXIT_ERRORS;
                         continue;
index d3644cb58abbea81be666a7a0b76e61f31ad6ad6..216be41ee2962c8550707285e89ad59eee8f3a3b 100644 (file)
@@ -124,7 +124,7 @@ static int unzzip_cat (int argc, char ** argv, int extract)
        {
            char* name = entry.d_name;
            FILE* out = stdout;
-           if (extract) out = create_fopen(name, "w", 1);
+           if (extract) out = create_fopen(name, "wb", 1);
            if (! out) {
                DBG3("fopen' %s : %s", name, strerror(errno));
                if (errno != EISDIR) done = EXIT_ERRORS;
@@ -146,7 +146,7 @@ static int unzzip_cat (int argc, char ** argv, int extract)
                    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);
                    if (! out) {
                        DBG3("fopen. %s : %s", name, strerror(errno));
                        if (errno != EISDIR) done = EXIT_ERRORS;
index 3b7f76175f4621eca4ea8c392866979c473436a4..e35648ac21ee0556bec49ec124b01b169213610c 100644 (file)
@@ -35,7 +35,7 @@ unzzip_list (int argc, char ** argv, int verbose)
     int argn;
     FILE* disk;
 
-    disk = fopen (argv[1], "r");
+    disk = fopen (argv[1], "rb");
     if (! disk) {
        perror(argv[1]);
        return exitcode(errno);