Archive-Unzip-Burst

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

pad_leavemy|||
pad_new|||
pad_push|||
pad_reset|||
pad_setsv|||
pad_sv|||
pad_swipe|||
pad_tidy|||
pad_undef|||
parse_body|||
parse_unicode_opts|||
path_is_absolute|||
peep|||
pending_ident|||
perl_alloc_using|||n
perl_alloc|||n
perl_clone_using|||n
perl_clone|||n
perl_construct|||n
perl_destruct||5.007003|n
perl_free|||n

unzip-6.0/History.600  view on Meta::CPAN

    wince/wcecfg.h : revised the UNICODE_SUPPORT code, added direct support for
    UTF-8 being the native MBCS char encoding, allowed separate activation of
    the "UTF-8 is native character coding" and the "translate UTF-8 <==> native
    extended-ASCII via Unicoded wchar_t" support methods.  [Chr. Spieler]
 - unix/configure, unix/Makefile: extended configure script to support
    automatic selection of UNICODE_SUPPORT support on capable systems,
    completed configuration support for the linking step.  [Chr. Spieler]
 - unix/unxcfg.h: changed interdependency rules of LARGE_FILE_SUPPORT and
    ZIP64_SUPPORT to prevent unsupported symbol combinations.  [Chr. Spieler]
 - man/unzip.1: extended description of -U option to mention the #Lxxxxxx
    escape format for characters beyond the basic unicode page.  [Chr. Spieler]
 - proginfo/extrafld.txt: updated wording and line wrapping of Info-ZIP
    Unicode extra fields.  [Chr. Spieler]

6.00e05 (09 Sep 08):
 - unix/unix.c - version(): added OS info support for Mac OS X (including a
    note for the recognized CPU architecture).  [Steven M. Schweda]
 - unix/configure: check for Mac OS X special linker options is only executed
    on systems that have been identified as Mac OS X.  [Steven M. Schweda]
 - unix/Makefile: moved "solaris" targets into new "autoconfig generic" group
    of machine target aliases.  [Steven M. Schweda, Chr. Spieler]

unzip-6.0/INSTALL  view on Meta::CPAN

           "wide character" data in Unicode encoding (UCS-2/UTF-16 or UCS-4),
           which are used to translate between UTF-8 and the native
           extended-ASCII character encoding.
           The code for this method is activated by setting the preprocessor
           symbol UNICODE_WCHAR.
           It may be activated together with UTF8_MAYBE_NATIVE to provide
           more versatile Unicode support and additional "debugging" options
           for checking the correct recognition of non-ASCII Unicode
           characters.
        c) The operating system and the compilation environment allow to use
           unicode-encoded "wide character" data for native text strings
           support.
           Complete support for this method requires a throughout revision
           of the UnZip code. All internal string handling and text output
           needs to be ported to use wchar_t character storage.
           This porting is still in an experimental stage and not ready
           for general distribution.

        On some ports UNICODE_SUPPORT is set automatically:
        - WIN32 (and WinCE) use method b) by defining UNICODE_SUPPORT and
          UNICODE_WCHAR.

unzip-6.0/README  view on Meta::CPAN

UnZip 6.0 finally supports nowadays "large" files of sizes > 2 GiB!
This is the first release containing support for the PKWARE Zip64
enhancements.
Major changes are:
   - Support PKWARE ZIP64 extensions, allowing Zip archives and Zip archive
     entries larger than 4 GiBytes and more than 65536 entries within a single
     Zip archive. This support is currently only available for Unix,
     OpenVMS and Win32/Win64.
   - Support for bzip2 compression method.
   - Support for UTF-8 encoded entry names, both through PKWARE's "General
     Purpose Flags Bit 11" indicator and Info-ZIP's new "up" unicode path
     extra field.  (Currently, on Windows the UTF-8 handling is limited to
     the character subset contained in the configured non-unicode "system
     code page".)
   - Added "wrong implementation used" warning to error messages of the MSDOS
     port when used under Win32, in an attempt to reduce false bug reports.
   - Fixed "Time of Creation/Time of Use" vulnerability when setting attributes
     of extracted files, for Unix and Unix-like ports.
   - Fixed memory leak when processing invalid deflated data.
   - Fixed long-standing bug in unshrink (partial_clear), added boundary checks
     against invalid compressed data.
   - On Unix, keep inherited SGID attribute bit for extracted directories
     unless restoration of owner/group id or SUID/SGID/Tacky attributes was

unzip-6.0/ToDo  view on Meta::CPAN


        top level item for 6.1

   o add multi-part zipfile handling

        major feature for 6.x!

        could happen for 6.1

   o better support for multilingual uses and different codepages;
     support unicode (UTF-8 coded) filenames and comment texts

        a requested feature getting more and more important,
        - partially done for the Windows port in 6.0
          (support restricted for chars of the current system codepage)
        - partially done (beta state) for Unix
          (requires native codepage to be UTF-8)

   o complete support for UTF-8 coded entry names (and comments)
     - add new "win32_wide" port to extend unicode support on Windows
       beyond the restrictions of the current (ANSI) system codepage
     - revise/extend the WinDLL interface to allow passing of "wide"
       string argument data
     - add simple built-in character translation between UTF-8 and the
       old (ISO-8851-1 / IBM850) code pages to allow old systems without
       standard UTF-8 support to read UTF-8 encoded archives.
     - extend the built-in translation tables to support other language
       regions besides "Western_Latin1" (e.g. Russian-kyrillic, Japanese,
       Chinese)
     - streamline the multilingual codepage and UTF-8 support for the UNIX

unzip-6.0/fileio.c  view on Meta::CPAN

   static ZCONST char Far CannotCreateFile[] =
     "error:  cannot create %s\n        %s\n";
#endif /* !TANDEM */
#endif /* !VMS && !AOS_VS && !CMS_MVS && !MACOS */

static ZCONST char Far ReadError[] = "error:  zipfile read error\n";
static ZCONST char Far FilenameTooLongTrunc[] =
  "warning:  filename too long--truncating.\n";
#ifdef UNICODE_SUPPORT
   static ZCONST char Far UFilenameTooLongTrunc[] =
     "warning:  Converted unicode filename too long--truncating.\n";
#endif
static ZCONST char Far ExtraFieldTooLong[] =
  "warning:  extra field too long (%d).  Ignoring...\n";

#ifdef WINDLL
   static ZCONST char Far DiskFullQuery[] =
     "%s:  write error (disk full?).\n";
#else
   static ZCONST char Far DiskFullQuery[] =
     "%s:  write error (disk full?).  Continue? (y/n/^C) ";

unzip-6.0/fileio.c  view on Meta::CPAN

                if (G.unipath_filename && strlen(G.unipath_filename) == 0) {
                  /* the standard filename field is UTF-8 */
                  free(G.unipath_filename);
                  G.unipath_filename = G.filename_full;
                }
              }
              if (G.unipath_filename) {
# ifdef UTF8_MAYBE_NATIVE
                if (G.native_is_utf8
#  ifdef UNICODE_WCHAR
                    && (!G.unicode_escape_all)
#  endif
                   ) {
                  strncpy(G.filename, G.unipath_filename, FILNAMSIZ - 1);
                  /* make sure filename is short enough */
                  if (strlen(G.unipath_filename) >= FILNAMSIZ) {
                    G.filename[FILNAMSIZ - 1] = '\0';
                    Info(slide, 0x401, ((char *)slide,
                      LoadFarString(UFilenameTooLongTrunc)));
                    error = PK_WARN;
                  }

unzip-6.0/fileio.c  view on Meta::CPAN

#  ifdef UNICODE_WCHAR
                else
#  endif
# endif /* UTF8_MAYBE_NATIVE */
# ifdef UNICODE_WCHAR
                {
                  char *fn;

                  /* convert UTF-8 to local character set */
                  fn = utf8_to_local_string(G.unipath_filename,
                                            G.unicode_escape_all);
                  /* make sure filename is short enough */
                  if (strlen(fn) >= FILNAMSIZ) {
                    fn[FILNAMSIZ - 1] = '\0';
                    Info(slide, 0x401, ((char *)slide,
                      LoadFarString(UFilenameTooLongTrunc)));
                    error = PK_WARN;
                  }
                  /* replace filename with converted UTF-8 */
                  strcpy(G.filename, fn);
                  free(fn);

unzip-6.0/globals.h  view on Meta::CPAN

    uch      *outbuf2;             /*  process_zipfiles() (never changes); */
#endif                             /*  else malloc'd ONLY if unshrink and -a */
#endif /* !FUNZIP */
    uch      *outptr;
    ulg      outcnt;               /* number of chars stored in outbuf */
#ifndef FUNZIP
    char     filename[FILNAMSIZ];  /* also used by NT for temporary SFX path */
#ifdef UNICODE_SUPPORT
    char     *filename_full;       /* the full path so Unicode checks work */
    extent   fnfull_bufsize;       /* size of allocated filename buffer */
    int      unicode_escape_all;
    int      unicode_mismatch;
#ifdef UTF8_MAYBE_NATIVE
    int      native_is_utf8;       /* bool, TRUE => native charset == UTF-8 */
#endif

    int      unipath_version;      /* version of Unicode field */
    ulg      unipath_checksum;     /* Unicode field checksum */
    char     *unipath_filename;    /* UTF-8 path */
#endif /* UNICODE_SUPPORT */

#ifdef CMS_MVS

unzip-6.0/man/unzip.1  view on Meta::CPAN

[VMS] convert text files (\fB\-a\fP, \fB\-aa\fP) into Stream_LF record format,
instead of the text-file default, variable-length record format.
(Stream_LF is the default record format of VMS \fIunzip\fP. It is applied
unless conversion (\fB\-a\fP, \fB\-aa\fP and/or \fB\-b\fP, \fB\-bb\fP) is
requested or a VMS-specific entry is processed.)
.TP
.B \-U
[UNICODE_SUPPORT only] modify or disable UTF-8 handling.
When UNICODE_SUPPORT is available, the option \fB\-U\fP forces \fIunzip\fP
to escape all non-ASCII characters from UTF-8 coded filenames as ``#Uxxxx''
(for UCS-2 characters, or ``#Lxxxxxx'' for unicode codepoints needing 3
octets).  This option is mainly provided for debugging purpose when the
fairly new UTF-8 support is suspected to mangle up extracted filenames.
.IP
The option \fB\-UU\fP allows to entirely disable the recognition of UTF-8
encoded filenames.  The handling of filename codings within \fIunzip\fP falls
back to the behaviour of previous versions.
.IP
[old, obsolete usage] leave filenames uppercase if
created under MS-DOS, VMS, etc.  See \fB\-L\fP above.
.TP

unzip-6.0/process.c  view on Meta::CPAN


          chksum = crc32(chksum, (uch *)(G.filename_full),
                         strlen(G.filename_full));

          /* If the checksums's don't match then likely filename has been
           * modified and the Unicode Path is no longer valid.
           */
          if (chksum != G.unipath_checksum) {
            Info(slide, 0x401, ((char *)slide,
              LoadFarString(UnicodeMismatchError)));
            if (G.unicode_mismatch == 1) {
              /* warn and continue */
            } else if (G.unicode_mismatch == 2) {
              /* ignore and continue */
            } else if (G.unicode_mismatch == 0) {
            }
            return PK_ERR;
          }

          /* UTF-8 Path */
          if ((G.unipath_filename = malloc(ULen + 1)) == NULL) {
            return PK_ERR;
          }
          if (ULen == 0) {
            /* standard path is UTF-8 so use that */

unzip-6.0/process.c  view on Meta::CPAN

      strncpy(utf8buf + count, mb, c);
    if (mbl == 1 && !mb[0])
      return count;           /* terminating nul */
    count += mbl;
  }
}


/* utf8_chars
 *
 * Wrapper: counts the actual unicode characters in a UTF-8 string.
 */
static int utf8_chars(utf8)
  ZCONST char *utf8;
{
  return utf8_to_ucs4_string(utf8, NULL, 0);
}
#endif /* unused */

/* --------------------------------------------------- */
/* Unicode Support

unzip-6.0/proginfo/extrafld.txt  view on Meta::CPAN

          0x4704        VM/CMS
          0x470f        MVS
          0x4854        Theos, old inofficial port
          0x4b46        FWKCS MD5 (see below)
          0x4c41        OS/2 access control list (text ACL)
          0x4d49        Info-ZIP OpenVMS (obsolete)
          0x4d63        Macintosh SmartZIP, by Macro Bambini
          0x4f4c        Xceed original location extra field
          0x5356        AOS/VS (binary ACL)
          0x5455        extended timestamp
          0x554e        Xceed unicode extra field
          0x5855        Info-ZIP UNIX (original; also OS/2, NT, etc.)
          0x6375        Info-ZIP UTF-8 comment field
          0x6542        BeOS (BeBox, PowerMac, etc.)
          0x6854        Theos
          0x7075        Info-ZIP UTF-8 name field
          0x7441        AtheOS (AtheOS/Syllable attributes)
          0x756e        ASi UNIX
          0x7855        Info-ZIP UNIX (16-bit UID/GID info)
          0x7875        Info-ZIP UNIX 3rd generation (generic UID/GID, ...)
          0xa220        Microsoft Open Packaging Growth Hint

unzip-6.0/unzip.c  view on Meta::CPAN

        }
        /* Note: At least for UnZip, trying to change the process codeset to
         *       UTF-8 does not work.  For the example Linux setup of the
         *       UnZip maintainer, a successful switch to "en-US.UTF-8"
         *       resulted in garbage display of all non-basic ASCII characters.
         */
    }
# endif /* UTF8_MAYBE_NATIVE */

    /* initialize Unicode */
    G.unicode_escape_all = 0;
    G.unicode_mismatch = 0;

    G.unipath_version = 0;
    G.unipath_checksum = 0;
    G.unipath_filename = NULL;
#endif /* UNICODE_SUPPORT */


#if (defined(__IBMC__) && defined(__DEBUG_ALLOC__))
    extern void DebugMalloc(void);

unzip-6.0/unzip.c  view on Meta::CPAN

        G.process_all_files = TRUE;      /* for speed */

    if (uO.exdir != (char *)NULL && !G.extract_flag)    /* -d ignored */
        Info(slide, 0x401, ((char *)slide, LoadFarString(NotExtracting)));
#endif /* ?(SFX && !SFX_EXDIR) */

#ifdef UNICODE_SUPPORT
    /* set Unicode-escape-all if option -U used */
    if (uO.U_flag == 1)
# ifdef UNICODE_WCHAR
        G.unicode_escape_all = TRUE;
# else
        Info(slide, 0x401, ((char *)slide, LoadFarString(UTF8EscapeUnSupp)));
# endif
#endif


/*---------------------------------------------------------------------------
    Okey dokey, we have everything we need to get started.  Let's roll.
  ---------------------------------------------------------------------------*/

unzip-6.0/unzip.txt  view on Meta::CPAN


       -S     [VMS] convert text files (-a, -aa) into Stream_LF record format,
              instead of the text-file default, variable-length record format.
              (Stream_LF  is  the  default  record  format of VMS unzip. It is
              applied unless conversion (-a, -aa and/or -b, -bb) is  requested
              or a VMS-specific entry is processed.)

       -U     [UNICODE_SUPPORT  only]  modify or disable UTF-8 handling.  When
              UNICODE_SUPPORT is available, the  option  -U  forces  unzip  to
              escape  all  non-ASCII  characters from UTF-8 coded filenames as
              ``#Uxxxx'' (for UCS-2 characters, or  ``#Lxxxxxx''  for  unicode
              codepoints  needing  3  octets).  This option is mainly provided
              for debugging purpose when the fairly new UTF-8 support is  sus-
              pected to mangle up extracted filenames.

              The  option  -UU  allows  to entirely disable the recognition of
              UTF-8 encoded  filenames.   The  handling  of  filename  codings
              within unzip falls back to the behaviour of previous versions.

              [old, obsolete usage] leave filenames uppercase if created under
              MS-DOS, VMS, etc.  See -L above.

unzip-6.0/win32-experimental/unz60d10_w32wide-Unicode_patch.txt  view on Meta::CPAN

+        hFile = CreateFileW(dw->fnw, FILE_WRITE_ATTRIBUTES,
+                            FILE_SHARE_READ|FILE_SHARE_WRITE, NULL,
+                            OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
+    }
+
+#ifdef NTSD_EAS
+    if (NtAtt(dw)->SDlen > 0) {
+        int err;
+
+        if (QCOND2) {
+            char *fn = wchar_to_local_string(dw->fnw, G.unicode_escape_all);
+            Info(slide, 1, ((char *)slide, " set attrib: %-22s  ",
+              FnFilter1(fn)));
+            free(fn);
+        }
+
+        /* set NTFS SD extra fields */
+        err = SetSD(__G__ dw->fnw, NtAtt(dw)->perms,
+                        NtAtt(dw)->buf, NtAtt(dw)->SDlen - EB_HEADSIZE);
+        if (err == IZ_EF_TRUNC) {
+            if (!QCOND2) {
+                char *fn = wchar_to_local_string(dw->fnw, G.unicode_escape_all);
+                Info(slide, 1, ((char *)slide, "%-22s  ",
+                  FnFilter1(fn)));
+                free(fn);
+            }
+            Info(slide, 1, ((char *)slide, LoadFarString(TruncNTSD),
+              NtAtt(dw)->SDlen-(EB_NTSD_L_LEN+EB_CMPRHEADLEN), "\n"));
+        } else if (QCOND2) {
+            Info(slide, 0, ((char *)slide, "\n"));
+        }
+        if (errval < err)
+            errval = err;
+    }
+#endif /* NTSD_EAS */
+
+    /* Skip restoring directory time stamps on user' request. */
+    if (uO.D_flag <= 0) {
+        if (hFile == INVALID_HANDLE_VALUE) {
+            char *fn = wchar_to_local_string(dw->fnw, G.unicode_escape_all);
+            Info(slide, 1, ((char *)slide,
+              "warning: CreateFile() error %d (set file times for %s)\n",
+              (int)GetLastError(), FnFilter1(fn)));
+            free(fn);
+            if (!errval)
+                errval = PK_WARN;
+        } else {
+            if (NtAtt(dw)->gotTime) {
+                FILETIME *pModft = (NtAtt(dw)->gotTime & EB_UT_FL_MTIME)
+                                  ? &(NtAtt(dw)->Modft) : NULL;
+                FILETIME *pAccft = (NtAtt(dw)->gotTime & EB_UT_FL_ATIME)
+                                  ? &(NtAtt(dw)->Accft) : NULL;
+                FILETIME *pCreft = (NtAtt(dw)->gotTime & EB_UT_FL_CTIME)
+                                  ? &(NtAtt(dw)->Creft) : NULL;
+
+                if (!SetFileTime(hFile, pCreft, pAccft, pModft)) {
+                    char *fn = wchar_to_local_string(dw->fnw,
+                                                     G.unicode_escape_all);
+                    Info(slide, 0, ((char *)slide,
+                      "warning:  SetFileTime() for %s error %d\n",
+                      FnFilter1(fn), (int)GetLastError()));
+                    free(fn);
+                    if (!errval)
+                        errval = PK_WARN;
+                }
+            }
+            CloseHandle(hFile);
+        }

unzip-6.0/win32-experimental/unz60d10_w32wide-Unicode_patch.txt  view on Meta::CPAN

+        wchar_t *pw = pathcompw;
         int too_long = FALSE;
-
-        Trace((stderr, "appending dir segment [%s]\n", FnFilter1(pathcomp)));
-        while ((*G.endHPFS = *p++) != '\0')     /* copy to HPFS filename */
-            ++G.endHPFS;
-        if (!IsVolumeOldFAT(__G__ G.buildpathHPFS)) {
-            p = pathcomp;
-            while ((*G.endFAT = *p++) != '\0')  /* copy to FAT filename, too */
-                ++G.endFAT;
+        char *buildpathFAT = wchar_to_local_string(G.buildpathFATw, G.unicode_escape_all);
+        char *buildpathHPFS = wchar_to_local_string(G.buildpathHPFSw, G.unicode_escape_all);
+        /* Could use G.filename from the standard path, but may
+           not work well on this port */
+        char *fn = wchar_to_local_string(G.unipath_widefilename, G.unicode_escape_all);
+
+        while ((*G.endHPFSw = *pw++) != '\0')     /* copy to HPFS filename */
+            ++G.endHPFSw;
+        if (!IsVolumeOldFATw(__G__ G.buildpathHPFSw)) {
+            pw = pathcompw;
+            while ((*G.endFATw = *pw++) != '\0')  /* copy to FAT filename, too */
+                ++G.endFATw;
         } else
-            map2fat(pathcomp, &G.endFAT);   /* map into FAT fn, update endFAT */
+            map2fatw(pathcompw, &G.endFATw);   /* map into FAT fn, update endFAT */

unzip-6.0/win32-experimental/unz60d10_w32wide-Unicode_patch.txt  view on Meta::CPAN

-                  "checkdir error:  cannot create %s\n\
-                 unable to process %s.\n",
-                  FnFilter2(G.buildpathFAT), FnFilter1(G.filename)));
-                free(G.buildpathHPFS);
-                free(G.buildpathFAT);
-                /* path didn't exist, tried to create, failed */
-                return MPN_ERR_SKIP;
-            }
-            G.created_dir = TRUE;
+            {
+				char *buildpathFAT = wchar_to_local_string(G.buildpathFATw, G.unicode_escape_all);
+				int i = MKDIRW(G.buildpathFATw, 0777);
+				if (i == -1) { /* create the directory */
+					Info(slide, 1, ((char *)slide,
+					  "checkdir error:  cannot create %s\n\
+					 unable to process %s.\n",
+					  FnFilter2(buildpathFAT), FnFilter1(fn)));
+					free(buildpathHPFS);
+					free(buildpathFAT);
+					free(fn);
+					free(G.buildpathHPFSw);

unzip-6.0/win32-experimental/unz60d10_w32wide-Unicode_patch.txt  view on Meta::CPAN

+        free(buildpathHPFS);
+        free(buildpathFAT);
+        free(fn);
+        //free(G.buildpathHPFSw);
+        //free(G.buildpathFATw);
         return MPN_OK;
 
@@ -2245,12 +3504,16 @@
 
     if (FUNCTION == GETPATH) {
+        char *buildpathFAT = wchar_to_local_string(G.buildpathFATw, G.unicode_escape_all);
+        char *buildpathHPFS = wchar_to_local_string(G.buildpathHPFSw, G.unicode_escape_all);
         Trace((stderr, "getting and freeing FAT path [%s]\n",
-          FnFilter1(G.buildpathFAT)));
+          FnFilter1(buildpathFAT)));
         Trace((stderr, "freeing HPFS path [%s]\n",
-          FnFilter1(G.buildpathHPFS)));
-        strcpy(pathcomp, G.buildpathFAT);
-        free(G.buildpathFAT);
-        free(G.buildpathHPFS);
-        G.buildpathHPFS = G.buildpathFAT = G.endHPFS = G.endFAT = NULL;
+          FnFilter1(buildpathHPFS)));

unzip-6.0/win32-experimental/unz60d10_w32wide-Unicode_patch.txt  view on Meta::CPAN

+        free(G.buildpathHPFSw);
+        G.buildpathHPFSw = G.buildpathFATw = G.endHPFSw = G.endFATw = NULL;
         return MPN_OK;
     }
@@ -2262,6 +3525,8 @@
 
     if (FUNCTION == APPEND_NAME) {
-        char *p = pathcomp;
+        wchar_t *pw = pathcompw;
         int error = MPN_OK;
+        char *pathcomp = wchar_to_local_string(pathcompw, G.unicode_escape_all);
+        char *fn = wchar_to_local_string(G.unipath_widefilename, G.unicode_escape_all);
 
         Trace((stderr, "appending filename [%s]\n", FnFilter1(pathcomp)));
@@ -2270,16 +3535,19 @@
          * for OS filename size limit overflow within the copy loop.
          */
-        while ((*G.endHPFS = *p++) != '\0') {   /* copy to HPFS filename */
-            ++G.endHPFS;
+        while ((*G.endHPFSw = *pw++) != '\0') {   /* copy to HPFS filename */
+            ++G.endHPFSw;
         }
         /* Now, check for OS filename size overflow.  When detected, the
          * mapped HPFS name is truncated and a warning message is shown.
          */
-        if ((G.endHPFS-G.buildpathHPFS) >= FILNAMSIZ) {
-            G.buildpathHPFS[FILNAMSIZ-1] = '\0';
+        if ((G.endHPFSw-G.buildpathHPFSw) >= FILNAMSIZ) {
+            char *buildpathHPFS;
+            G.buildpathHPFSw[FILNAMSIZ-1] = '\0';
+            buildpathHPFS = wchar_to_local_string(G.buildpathHPFSw, G.unicode_escape_all);
             Info(slide, 1, ((char *)slide,
               "checkdir warning:  path too long; truncating\n \
               %s\n                -> %s\n",
-              FnFilter1(G.filename), FnFilter2(G.buildpathHPFS)));
+              FnFilter1(fn), FnFilter2(buildpathHPFS)));
+            free(buildpathHPFS);
             error = MPN_INF_TRUNC;  /* filename truncated */
         }
@@ -2289,12 +3557,12 @@
          * within the following copy loop, either.

unzip-6.0/win32-experimental/unz60d10_w32wide-Unicode_patch.txt  view on Meta::CPAN

@@ -2305,8 +3573,16 @@
          * has already happened.
          */
-        if ((G.endFAT-G.buildpathFAT) >= FILNAMSIZ)
-            G.buildpathFAT[FILNAMSIZ-1] = '\0';
-        Trace((stderr, "buildpathHPFS: %s\nbuildpathFAT:  %s\n",
-          FnFilter1(G.buildpathHPFS), FnFilter2(G.buildpathFAT)));
+        if ((G.endFATw-G.buildpathFATw) >= FILNAMSIZ)
+            G.buildpathFATw[FILNAMSIZ-1] = '\0';
+        {
+          char *buildpathHPFS = wchar_to_local_string(G.buildpathHPFSw, G.unicode_escape_all);
+          char *buildpathFAT = wchar_to_local_string(G.buildpathFATw,G.unicode_escape_all);
+          Trace((stderr, "buildpathHPFS: %s\nbuildpathFAT:  %s\n",
+            FnFilter1(buildpathHPFS), FnFilter2(buildpathFAT)));
+          free(buildpathHPFS);
+          free(buildpathFAT);
+        }
+        free(fn);
+        free(pathcomp);
 
         return error;  /* could check for existence, prompt for new name... */
@@ -2321,33 +3597,23 @@

unzip-6.0/win32-experimental/unz60d10_w32wide-Unicode_patch.txt  view on Meta::CPAN

-            ++G.endHPFS;
+            *G.buildpathHPFSw = '\0';
+        G.endHPFSw = G.buildpathHPFSw;
+        G.endFATw = G.buildpathFATw;
+        while ((*G.endFATw = *G.endHPFSw) != '\0') {
+            ++G.endFATw;
+            ++G.endHPFSw;
         }
-        Trace((stderr, "[%s]\n", FnFilter1(G.buildpathHPFS)));
+        {
+          char *buildpathHPFS = wchar_to_local_string(G.buildpathHPFSw, G.unicode_escape_all);
+          Trace((stderr, "[%s]\n", FnFilter1(buildpathHPFS)));
+          free(buildpathHPFS);
+        }
+
         return MPN_OK;
     }
@@ -2395,7 +3666,9 @@
 #if (!defined(SFX) || defined(SFX_EXDIR))
     if (FUNCTION == ROOT) {
+        char *pathcomp = wchar_to_local_string(pathcompw, G.unicode_escape_all);
         Trace((stderr, "initializing root path to [%s]\n",
           FnFilter1(pathcomp)));
-        if (pathcomp == NULL) {
+        free(pathcomp);
+        if (pathcompw == NULL) {
             G.rootlen = 0;
             return MPN_OK;
@@ -2403,17 +3676,17 @@
         if (G.rootlen > 0)      /* rootpath was already set, nothing to do */
             return MPN_OK;

unzip-6.0/win32-experimental/unz60d10_w32wide-Unicode_patch.txt  view on Meta::CPAN

                     if (!G.create_dirs /* || iswild(tmproot) */ ) {
-                        free(tmproot);
+                        free(tmprootw);
                         G.rootlen = 0;
                         /* treat as stored file */
@@ -2433,12 +3706,15 @@
                     /* create directory (could add loop here scanning tmproot
                      * to create more than one level, but really necessary?) */
-                    if (MKDIR(tmproot, 0777) == -1) {
+                    if (MKDIRW(tmprootw, 0777) == -1) {
+                        char *tmproot = wchar_to_local_string(tmprootw, G.unicode_escape_all);
                         Info(slide, 1, ((char *)slide,
                           "checkdir:  cannot create extraction directory: %s\n",
                           FnFilter1(tmproot)));
                         free(tmproot);
+                        free(tmprootw);
                         G.rootlen = 0;
                         /* path didn't exist, tried to create, failed: */
                         /* file exists, or need 2+ subdir levels */
+                        free(pathcomp);
                         return MPN_ERR_SKIP;

unzip-6.0/win32-experimental/unz60d10_w32wide-Unicode_patch.txt  view on Meta::CPAN

+                tmprootw[G.rootlen++] = '.';
+            tmprootw[G.rootlen++] = '/';
+            tmprootw[G.rootlen] = '\0';
+            if ((G.rootpathw = (wchar_t *)realloc(tmprootw, (G.rootlen+1) * sizeof(wchar_t))) == NULL) {
+                free(tmprootw);
                 G.rootlen = 0;
                 return MPN_NOMEM;
             }
-            Trace((stderr, "rootpath now = [%s]\n", FnFilter1(G.rootpath)));
+            {
+              char *rootpath = wchar_to_local_string(G.rootpathw, G.unicode_escape_all);
+              Trace((stderr, "rootpath now = [%s]\n", FnFilter1(rootpath)));
+              free(rootpath);
+            }
         }
         return MPN_OK;
@@ -2467,5 +3747,5 @@
         Trace((stderr, "freeing rootpath\n"));
         if (G.rootlen > 0) {
-            free(G.rootpath);
+            free(G.rootpathw);

unzip-6.0/win32-experimental/unz60d10_w32wide-Unicode_patch.txt  view on Meta::CPAN

 }
 
+
+
+#if defined(UNICODE_SUPPORT) && defined(WIN32_WIDE)
+
+int zstat_win32w(__W32STAT_GLOBALS__ const wchar_t *pathw, z_stat *buf)
+{
+    if (!zstatw(pathw, buf))
+    {
+        char *path = wchar_to_local_string((wchar_t *)pathw, G.unicode_escape_all);
+        /* stat was successful, now redo the time-stamp fetches */
+#ifndef NO_W32TIMES_IZFIX
+        int fs_uses_loctime = FStampIsLocTimeW(__G__ pathw);
+#endif
+        HANDLE h;
+        FILETIME Modft, Accft, Creft;
+
+        TTrace((stdout, "stat(%s) finds modtime %08lx\n", path, buf->st_mtime));
+        h = CreateFileW(pathw, GENERIC_READ,
+                        FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,

unzip-6.0/win32-experimental/unz60d10_w32wide-Unicode_patch.txt  view on Meta::CPAN

+
+        return 0;
+    }
+#ifdef W32_STATROOT_FIX
+    else
+    {
+        DWORD flags;
+
+        flags = GetFileAttributesW(pathw);
+        if (flags != 0xFFFFFFFF && flags & FILE_ATTRIBUTE_DIRECTORY) {
+            char *path = wchar_to_local_string((wchar_t *)pathw, G.unicode_escape_all);
+            Trace((stderr, "\nstat(\"%s\",...) failed on existing directory\n",
+                   FnFilter1(path)));
+            free(path);
+            memset(buf, 0, sizeof(z_stat));
+            buf->st_atime = buf->st_ctime = buf->st_mtime =
+              dos_to_unix_time(DOSTIME_MINIMUM);        /* 1-1-80 */
+            buf->st_mode = S_IFDIR | S_IREAD |
+                           ((flags & FILE_ATTRIBUTE_READONLY) ? 0 : S_IWRITE);
+            return 0;
+        } /* assumes: stat() won't fail on non-dirs without good reason */

unzip-6.0/win32/Makefile  view on Meta::CPAN

#   USEZLIBDLL=1        : replace built-in inflate by external zlib dll
#   USEZLIBSTAT=1       : replace built-in inflate by external zlib static lib
#   USEZLIB=1           : alias for USEZLIBSTAT=1
#
#   USE_DLLRUNTIME      : link executables against C runtime dll
#                         (default: executables are linked against static lib)
#                         USEBZ2DLL or USEZLIBDLL imply USE_DLLRUNTIME !
#   DLLSTANDALONE       : unzip32.dll is linked against static MT runtime lib
#                         (default: unzip32.dll linked against C runtime dll)
#
#   USE_UTF8            : =0 no unicode names support
#                         =1 force recognition of UTF8 extra fields and
#                            "UTF8 name" attrib (default)
#
#   USEASM              : use assembler code for crc32 function (default)
#   NOASM               : use C implementation for crc32 function
#   USEMASM             : use MS macro assembler (MASM) to assemble crc32 code
#   USEML               : use MS macro assembler (ML driver) to create crc32
#                         (default: use C inline assembler code for crc32)
#
#   NOCRC_OPT=1         : disable "unfolding CRC tables" optimization

unzip-6.0/wince/wcemain.c  view on Meta::CPAN

    TCHAR Blank = _T(' ');

    /* Init the arrays */
    for (i = 0; i < 10;i++)
        argArray[i];
    for (i = 0;i < 10;i++)
        argv[i] = NULL;


    /* Create the argument array, we have to convert this from wchar
     * (unicode) to mbcs (single byte ascii)
     */
    while(argPtr != NULL)
    {
        /* Look for the first non-blank character */
        while((memcmp(argPtr, &Blank, sizeof(TCHAR)) == 0) &&
              (argPtr < endOfCmdLine))
        {
            argPtr++;
        }



( run in 1.364 second using v1.01-cache-2.11-cpan-88abd93f124 )