Merge lp:~logan/ubuntu/quantal/unzip/debian-merge into lp:ubuntu/quantal/unzip
- Quantal (12.10)
- debian-merge
- Merge into quantal
Proposed by
Logan Rosen
Status: | Merged | ||||
---|---|---|---|---|---|
Merge reported by: | Luke Yelavich | ||||
Merged at revision: | not available | ||||
Proposed branch: | lp:~logan/ubuntu/quantal/unzip/debian-merge | ||||
Merge into: | lp:ubuntu/quantal/unzip | ||||
Diff against target: |
16882 lines (+485/-15893) 32 files modified
.pc/.quilt_patches (+1/-0) .pc/.quilt_series (+1/-0) .pc/01-manpages-in-section-1-not-in-section-1l/man/funzip.1 (+0/-127) .pc/01-manpages-in-section-1-not-in-section-1l/man/unzip.1 (+0/-1040) .pc/01-manpages-in-section-1-not-in-section-1l/man/unzipsfx.1 (+0/-336) .pc/01-manpages-in-section-1-not-in-section-1l/man/zipgrep.1 (+0/-89) .pc/01-manpages-in-section-1-not-in-section-1l/man/zipinfo.1 (+0/-517) .pc/02-branding-patch-this-is-debian-unzip/unzip.c (+0/-2655) .pc/03-include-unistd-for-kfreebsd/unix/unxcfg.h (+0/-230) .pc/04-unzip60-alt-iconv-utf8/unix/unix.c (+0/-1876) .pc/04-unzip60-alt-iconv-utf8/unix/unxcfg.h (+0/-231) .pc/04-unzip60-alt-iconv-utf8/unzip.c (+0/-2654) .pc/04-unzip60-alt-iconv-utf8/unzpriv.h (+0/-3123) .pc/04-unzip60-alt-iconv-utf8/zipinfo.c (+0/-2315) .pc/applied-patches (+0/-4) debian/changelog (+29/-0) debian/control (+2/-1) debian/patches/04-handle-pkware-verification-bit (+21/-0) debian/patches/04-unzip60-alt-iconv-utf8 (+0/-377) debian/patches/05-unzip60-alt-iconv-utf8 (+377/-0) debian/patches/series (+2/-1) debian/rules (+8/-7) man/funzip.1 (+4/-4) man/unzip.1 (+12/-12) man/unzipsfx.1 (+16/-16) man/zipgrep.1 (+4/-4) man/zipinfo.1 (+5/-5) unix/unix.c (+0/-90) unix/unxcfg.h (+0/-27) unzip.c (+2/-89) unzpriv.h (+1/-1) zipinfo.c (+0/-62) |
||||
To merge this branch: | bzr merge lp:~logan/ubuntu/quantal/unzip/debian-merge | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel Holbach (community) | Approve | ||
Ubuntu branches | Pending | ||
Review via email: mp+118283@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file '.pc/.quilt_patches' |
2 | --- .pc/.quilt_patches 1970-01-01 00:00:00 +0000 |
3 | +++ .pc/.quilt_patches 2012-08-06 01:42:18 +0000 |
4 | @@ -0,0 +1,1 @@ |
5 | +debian/patches |
6 | |
7 | === added file '.pc/.quilt_series' |
8 | --- .pc/.quilt_series 1970-01-01 00:00:00 +0000 |
9 | +++ .pc/.quilt_series 2012-08-06 01:42:18 +0000 |
10 | @@ -0,0 +1,1 @@ |
11 | +series |
12 | |
13 | === removed directory '.pc/01-manpages-in-section-1-not-in-section-1l' |
14 | === removed directory '.pc/01-manpages-in-section-1-not-in-section-1l/man' |
15 | === removed file '.pc/01-manpages-in-section-1-not-in-section-1l/man/funzip.1' |
16 | --- .pc/01-manpages-in-section-1-not-in-section-1l/man/funzip.1 2010-02-21 17:01:00 +0000 |
17 | +++ .pc/01-manpages-in-section-1-not-in-section-1l/man/funzip.1 1970-01-01 00:00:00 +0000 |
18 | @@ -1,127 +0,0 @@ |
19 | -.\" Copyright (c) 1990-2009 Info-ZIP. All rights reserved. |
20 | -.\" |
21 | -.\" See the accompanying file LICENSE, version 2009-Jan-02 or later |
22 | -.\" (the contents of which are also included in unzip.h) for terms of use. |
23 | -.\" If, for some reason, all these files are missing, the Info-ZIP license |
24 | -.\" also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html |
25 | -.\" |
26 | -.\" funzip.1 by Greg Roelofs and others. |
27 | -.\" |
28 | -.\" ========================================================================= |
29 | -.\" define .EX/.EE (for multiline user-command examples; normal Courier font) |
30 | -.de EX |
31 | -.in +4n |
32 | -.nf |
33 | -.ft CW |
34 | -.. |
35 | -.de EE |
36 | -.ft R |
37 | -.fi |
38 | -.in -4n |
39 | -.. |
40 | -.\" ========================================================================= |
41 | -.TH FUNZIP 1L "20 April 2009 (v3.95)" "Info-ZIP" |
42 | -.SH NAME |
43 | -funzip \- filter for extracting from a ZIP archive in a pipe |
44 | -.PD |
45 | -.SH SYNOPSIS |
46 | -\fBfunzip\fP [\fB\-password\fP] [\fIinput[.zip|.gz]\fP] |
47 | -.\" ========================================================================= |
48 | -.SH ARGUMENTS |
49 | -.IP [\fI\-password\fP] |
50 | -Optional password to be used if ZIP archive is encrypted. Decryption |
51 | -may not be supported at some sites. See DESCRIPTION for more details. |
52 | -.IP [\fIinput[.zip|.gz]\fP] |
53 | -Optional input archive file specification. See DESCRIPTION for details. |
54 | -.PD |
55 | -.\" ========================================================================= |
56 | -.SH DESCRIPTION |
57 | -.I funzip |
58 | -without a file argument acts as a filter; that is, it assumes that a |
59 | -ZIP archive (or a \fIgzip\fP'd(1) file) is being piped into |
60 | -standard input, and it extracts the first member from the archive to stdout. |
61 | -When stdin comes from a tty device, |
62 | -.I funzip |
63 | -assumes that this cannot be a stream of (binary) compressed data and |
64 | -shows a short help text, instead. |
65 | -If there is a file argument, then input is read from the specified file |
66 | -instead of from stdin. |
67 | -.PP |
68 | -A password for encrypted zip files can be specified |
69 | -on the command line (preceding the file name, if any) by prefixing the |
70 | -password with a dash. Note that this constitutes a security risk on many |
71 | -systems; currently running processes are often visible via simple commands |
72 | -(e.g., \fIps\fP(1) under Unix), and command-line histories can be read. |
73 | -If the first entry of the zip file is encrypted and |
74 | -no password is specified on the command line, then the user is prompted for |
75 | -a password and the password is not echoed on the console. |
76 | -.PP |
77 | -Given the limitation on single-member extraction, \fIfunzip\fP is most |
78 | -useful in conjunction with a secondary archiver program such as \fItar\fP(1). |
79 | -The following section includes an example illustrating this usage in the |
80 | -case of disk backups to tape. |
81 | -.PD |
82 | -.\" ========================================================================= |
83 | -.SH EXAMPLES |
84 | -To use \fIfunzip\fP to extract the first member file of the archive test.zip |
85 | -and to pipe it into \fImore\fP(1): |
86 | -.PP |
87 | -.EX |
88 | -funzip test.zip | more |
89 | -.EE |
90 | -.PP |
91 | -To use \fIfunzip\fP to test the first member file of test.zip (any errors |
92 | -will be reported on standard error): |
93 | -.PP |
94 | -.EX |
95 | -funzip test.zip > /dev/null |
96 | -.EE |
97 | -.PP |
98 | -To use \fIzip\fP and \fIfunzip\fP in place of \fIcompress\fP(1) and |
99 | -\fIzcat\fP(1) (or \fIgzip\fP(1L) and \fIgzcat\fP(1L)) for tape backups: |
100 | -.PP |
101 | -.EX |
102 | -tar cf \- . | zip \-7 | dd of=/dev/nrst0 obs=8k |
103 | -dd if=/dev/nrst0 ibs=8k | funzip | tar xf \- |
104 | -.EE |
105 | -.PP |
106 | -(where, for example, nrst0 is a SCSI tape drive). |
107 | -.PD |
108 | -.\" ========================================================================= |
109 | -.SH BUGS |
110 | -When piping an encrypted file into \fImore\fP and allowing \fIfunzip\fP |
111 | -to prompt for password, the terminal may sometimes be reset to a non-echo |
112 | -mode. This is apparently due to a race condition between the two programs; |
113 | -\fIfunzip\fP changes the terminal mode to non-echo before \fImore\fP reads |
114 | -its state, and \fImore\fP then ``restores'' the terminal to this mode before |
115 | -exiting. To recover, run \fIfunzip\fP on the same file but redirect to |
116 | -/dev/null rather than piping into more; after prompting again for the |
117 | -password, \fIfunzip\fP will reset the terminal properly. |
118 | -.PP |
119 | -There is presently no way to extract any member but the first from a ZIP |
120 | -archive. This would be useful in the case where a ZIP archive is included |
121 | -within another archive. In the case where the first member is a directory, |
122 | -\fIfunzip\fP simply creates the directory and exits. |
123 | -.PP |
124 | -The functionality of \fIfunzip\fP should be incorporated into \fIunzip\fP |
125 | -itself (future release). |
126 | -.PD |
127 | -.\" ========================================================================= |
128 | -.SH "SEE ALSO" |
129 | -\fIgzip\fP(1L), \fIunzip\fP(1L), \fIunzipsfx\fP(1L), \fIzip\fP(1L), |
130 | -\fIzipcloak\fP(1L), \fIzipinfo\fP(1L), \fIzipnote\fP(1L), \fIzipsplit\fP(1L) |
131 | -.PD |
132 | -.\" ========================================================================= |
133 | -.SH URL |
134 | -The Info-ZIP home page is currently at |
135 | -.EX |
136 | -\fChttp://www.info-zip.org/pub/infozip/\fR |
137 | -.EE |
138 | -or |
139 | -.EX |
140 | -\fCftp://ftp.info-zip.org/pub/infozip/\fR . |
141 | -.EE |
142 | -.PD |
143 | -.\" ========================================================================= |
144 | -.SH AUTHOR |
145 | -Mark Adler (Info-ZIP) |
146 | |
147 | === removed file '.pc/01-manpages-in-section-1-not-in-section-1l/man/unzip.1' |
148 | --- .pc/01-manpages-in-section-1-not-in-section-1l/man/unzip.1 2010-02-21 17:01:00 +0000 |
149 | +++ .pc/01-manpages-in-section-1-not-in-section-1l/man/unzip.1 1970-01-01 00:00:00 +0000 |
150 | @@ -1,1040 +0,0 @@ |
151 | -.\" Copyright (c) 1990-2009 Info-ZIP. All rights reserved. |
152 | -.\" |
153 | -.\" See the accompanying file LICENSE, version 2009-Jan-02 or later |
154 | -.\" (the contents of which are also included in unzip.h) for terms of use. |
155 | -.\" If, for some reason, all these files are missing, the Info-ZIP license |
156 | -.\" also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html |
157 | -.\" |
158 | -.\" unzip.1 by Greg Roelofs, Fulvio Marino, Jim van Zandt and others. |
159 | -.\" |
160 | -.\" ========================================================================= |
161 | -.\" define .EX/.EE (for multiline user-command examples; normal Courier font) |
162 | -.de EX |
163 | -.in +4n |
164 | -.nf |
165 | -.ft CW |
166 | -.. |
167 | -.de EE |
168 | -.ft R |
169 | -.fi |
170 | -.in -4n |
171 | -.. |
172 | -.\" ========================================================================= |
173 | -.TH UNZIP 1L "20 April 2009 (v6.0)" "Info-ZIP" |
174 | -.SH NAME |
175 | -unzip \- list, test and extract compressed files in a ZIP archive |
176 | -.PD |
177 | -.SH SYNOPSIS |
178 | -\fBunzip\fP [\fB\-Z\fP] [\fB\-cflptTuvz\fP[\fBabjnoqsCDKLMUVWX$/:^\fP]] |
179 | -\fIfile\fP[\fI.zip\fP] [\fIfile(s)\fP\ .\|.\|.] |
180 | -[\fB\-x\fP\ \fIxfile(s)\fP\ .\|.\|.] [\fB\-d\fP\ \fIexdir\fP] |
181 | -.PD |
182 | -.\" ========================================================================= |
183 | -.SH DESCRIPTION |
184 | -\fIunzip\fP will list, test, or extract files from a ZIP archive, commonly |
185 | -found on MS-DOS systems. The default behavior (with no options) is to extract |
186 | -into the current directory (and subdirectories below it) all files from the |
187 | -specified ZIP archive. A companion program, \fIzip\fP(1L), creates ZIP |
188 | -archives; both programs are compatible with archives created by PKWARE's |
189 | -\fIPKZIP\fP and \fIPKUNZIP\fP for MS-DOS, but in many cases the program |
190 | -options or default behaviors differ. |
191 | -.PD |
192 | -.\" ========================================================================= |
193 | -.SH ARGUMENTS |
194 | -.TP |
195 | -.IR file [ .zip ] |
196 | -Path of the ZIP archive(s). If the file specification is a wildcard, |
197 | -each matching file is processed in an order determined by the operating |
198 | -system (or file system). Only the filename can be a wildcard; the path |
199 | -itself cannot. Wildcard expressions are similar to those supported in |
200 | -commonly used Unix shells (\fIsh\fP, \fIksh\fP, \fIcsh\fP) and may contain: |
201 | -.RS |
202 | -.IP * |
203 | -matches a sequence of 0 or more characters |
204 | -.IP ? |
205 | -matches exactly 1 character |
206 | -.IP [.\|.\|.] |
207 | -matches any single character found inside the brackets; ranges are specified |
208 | -by a beginning character, a hyphen, and an ending character. If an exclamation |
209 | -point or a caret (`!' or `^') follows the left bracket, then the range of |
210 | -characters within the brackets is complemented (that is, anything \fIexcept\fP |
211 | -the characters inside the brackets is considered a match). To specify a |
212 | -verbatim left bracket, the three-character sequence ``[[]'' has to be used. |
213 | -.RE |
214 | -.IP |
215 | -(Be sure to quote any character that might otherwise be interpreted or |
216 | -modified by the operating system, particularly under Unix and VMS.) If no |
217 | -matches are found, the specification is assumed to be a literal filename; |
218 | -and if that also fails, the suffix \fC.zip\fR is appended. Note that |
219 | -self-extracting ZIP files are supported, as with any other ZIP archive; |
220 | -just specify the \fC.exe\fR suffix (if any) explicitly. |
221 | -.IP [\fIfile(s)\fP] |
222 | -An optional list of archive members to be processed, separated by spaces. |
223 | -(VMS versions compiled with VMSCLI defined must delimit files with commas |
224 | -instead. See \fB\-v\fP in \fBOPTIONS\fP below.) |
225 | -Regular expressions (wildcards) may be used to match multiple members; see |
226 | -above. Again, be sure to quote expressions that would otherwise be expanded |
227 | -or modified by the operating system. |
228 | -.IP [\fB\-x\fP\ \fIxfile(s)\fP] |
229 | -An optional list of archive members to be excluded from processing. |
230 | -Since wildcard characters normally match (`/') directory separators |
231 | -(for exceptions see the option \fB\-W\fP), this option may be used |
232 | -to exclude any files that are in subdirectories. For |
233 | -example, ``\fCunzip foo *.[ch] -x */*\fR'' would extract all C source files |
234 | -in the main directory, but none in any subdirectories. Without the \fB\-x\fP |
235 | -option, all C source files in all directories within the zipfile would be |
236 | -extracted. |
237 | -.IP [\fB\-d\fP\ \fIexdir\fP] |
238 | -An optional directory to which to extract files. By default, all files |
239 | -and subdirectories are recreated in the current directory; the \fB\-d\fP |
240 | -option allows extraction in an arbitrary directory (always assuming one |
241 | -has permission to write to the directory). This option need not appear |
242 | -at the end of the command line; it is also accepted before the zipfile |
243 | -specification (with the normal options), immediately after the zipfile |
244 | -specification, or between the \fIfile(s)\fP and the \fB\-x\fP option. |
245 | -The option and directory may be concatenated without any white space |
246 | -between them, but note that this may cause normal shell behavior to be |
247 | -suppressed. In particular, ``\fC\-d\ ~\fR'' (tilde) is expanded by Unix |
248 | -C shells into the name of the user's home directory, but ``\fC\-d~\fR'' |
249 | -is treated as a literal subdirectory ``\fB~\fP'' of the current directory. |
250 | -.\" ========================================================================= |
251 | -.SH OPTIONS |
252 | -Note that, in order to support obsolescent hardware, \fIunzip\fP's usage |
253 | -screen is limited to 22 or 23 lines and should therefore be considered |
254 | -only a reminder of the basic \fIunzip\fP syntax rather than an exhaustive |
255 | -list of all possible flags. The exhaustive list follows: |
256 | -.TP |
257 | -.B \-Z |
258 | -\fIzipinfo\fP(1L) mode. If the first option on the command line is \fB\-Z\fP, |
259 | -the remaining options are taken to be \fIzipinfo\fP(1L) options. See the |
260 | -appropriate manual page for a description of these options. |
261 | -.TP |
262 | -.B \-A |
263 | -[OS/2, Unix DLL] print extended help for the DLL's programming interface (API). |
264 | -.TP |
265 | -.B \-c |
266 | -extract files to stdout/screen (``CRT''). This option is similar to the |
267 | -\fB\-p\fP option except that the name of each file is printed as it is |
268 | -extracted, the \fB\-a\fP option is allowed, and ASCII-EBCDIC conversion |
269 | -is automatically performed if appropriate. This option is not listed in |
270 | -the \fIunzip\fP usage screen. |
271 | -.TP |
272 | -.B \-f |
273 | -freshen existing files, i.e., extract only those files that |
274 | -already exist on disk and that are newer than the disk copies. By |
275 | -default \fIunzip\fP queries before overwriting, but the \fB\-o\fP option |
276 | -may be used to suppress the queries. Note that under many operating systems, |
277 | -the TZ (timezone) environment variable must be set correctly in order for |
278 | -\fB\-f\fP and \fB\-u\fP to work properly (under Unix the variable is usually |
279 | -set automatically). The reasons for this are somewhat subtle but |
280 | -have to do with the differences between DOS-format file times (always local |
281 | -time) and Unix-format times (always in GMT/UTC) and the necessity to compare |
282 | -the two. A typical TZ value is ``PST8PDT'' (US Pacific time with automatic |
283 | -adjustment for Daylight Savings Time or ``summer time''). |
284 | -.TP |
285 | -.B \-l |
286 | -list archive files (short format). The names, uncompressed file sizes and |
287 | -modification dates and times of the specified files are printed, along |
288 | -with totals for all files specified. If UnZip was compiled with OS2_EAS |
289 | -defined, the \fB\-l\fP option also lists columns for the sizes of stored |
290 | -OS/2 extended attributes (EAs) and OS/2 access control lists (ACLs). In |
291 | -addition, the zipfile comment and individual file comments (if any) are |
292 | -displayed. If a file was archived from a single-case file system (for |
293 | -example, the old MS-DOS FAT file system) and the \fB\-L\fP option was given, |
294 | -the filename is converted to lowercase and is prefixed with a caret (^). |
295 | -.TP |
296 | -.B \-p |
297 | -extract files to pipe (stdout). Nothing but the file data is sent to |
298 | -stdout, and the files are always extracted in binary format, just as they |
299 | -are stored (no conversions). |
300 | -.TP |
301 | -.B \-t |
302 | -test archive files. This option extracts each specified file in memory |
303 | -and compares the CRC (cyclic redundancy check, an enhanced checksum) of |
304 | -the expanded file with the original file's stored CRC value. |
305 | -.TP |
306 | -.B \-T |
307 | -[most OSes] set the timestamp on the archive(s) to that of the newest file |
308 | -in each one. This corresponds to \fIzip\fP's \fB\-go\fP option except that |
309 | -it can be used on wildcard zipfiles (e.g., ``\fCunzip \-T \e*.zip\fR'') and |
310 | -is much faster. |
311 | -.TP |
312 | -.B \-u |
313 | -update existing files and create new ones if needed. This option performs |
314 | -the same function as the \fB\-f\fP option, extracting (with query) files |
315 | -that are newer than those with the same name on disk, and in addition it |
316 | -extracts those files that do not already exist on disk. See \fB\-f\fP |
317 | -above for information on setting the timezone properly. |
318 | -.TP |
319 | -.B \-v |
320 | -list archive files (verbose format) or show diagnostic version info. |
321 | -This option has evolved and now behaves as both an option and a modifier. |
322 | -As an option it has two purposes: when a zipfile is specified with no |
323 | -other options, \fB\-v\fP lists archive files verbosely, adding to the |
324 | -basic \fB\-l\fP info the compression method, compressed size, |
325 | -compression ratio and 32-bit CRC. In contrast to most of the competing |
326 | -utilities, \fIunzip\fP removes the 12 additional header bytes of |
327 | -encrypted entries from the compressed size numbers. Therefore, |
328 | -compressed size and compression ratio figures are independent of the entry's |
329 | -encryption status and show the correct compression performance. (The complete |
330 | -size of the encrypted compressed data stream for zipfile entries is reported |
331 | -by the more verbose \fIzipinfo\fP(1L) reports, see the separate manual.) |
332 | -When no zipfile is specified (that is, the complete command is simply |
333 | -``\fCunzip \-v\fR''), a diagnostic screen is printed. In addition to |
334 | -the normal header with release date and version, \fIunzip\fP lists the |
335 | -home Info-ZIP ftp site and where to find a list of other ftp and non-ftp |
336 | -sites; the target operating system for which it was compiled, as well |
337 | -as (possibly) the hardware on which it was compiled, the compiler and |
338 | -version used, and the compilation date; any special compilation options |
339 | -that might affect the program's operation (see also \fBDECRYPTION\fP below); |
340 | -and any options stored in environment variables that might do the same |
341 | -(see \fBENVIRONMENT OPTIONS\fP below). As a modifier it works in |
342 | -conjunction with other options (e.g., \fB\-t\fP) to produce more |
343 | -verbose or debugging output; this is not yet fully implemented |
344 | -but will be in future releases. |
345 | -.TP |
346 | -.B \-z |
347 | -display only the archive comment. |
348 | -.PD |
349 | -.\" ========================================================================= |
350 | -.SH MODIFIERS |
351 | -.TP |
352 | -.B \-a |
353 | -convert text files. Ordinarily all files are extracted exactly as they |
354 | -are stored (as ``binary'' files). The \fB\-a\fP option causes files identified |
355 | -by \fIzip\fP as text files (those with the `t' label in \fIzipinfo\fP |
356 | -listings, rather than `b') to be automatically extracted as such, converting |
357 | -line endings, end-of-file characters and the character set itself as necessary. |
358 | -(For example, Unix files use line feeds (LFs) for end-of-line (EOL) and |
359 | -have no end-of-file (EOF) marker; Macintoshes use carriage returns (CRs) |
360 | -for EOLs; and most PC operating systems use CR+LF for EOLs and control-Z for |
361 | -EOF. In addition, IBM mainframes and the Michigan Terminal System use EBCDIC |
362 | -rather than the more common ASCII character set, and NT supports Unicode.) |
363 | -Note that \fIzip\fP's identification of text files is by no means perfect; some |
364 | -``text'' files may actually be binary and vice versa. \fIunzip\fP therefore |
365 | -prints ``\fC[text]\fR'' or ``\fC[binary]\fR'' as a visual check for each file |
366 | -it extracts when using the \fB\-a\fP option. The \fB\-aa\fP option forces |
367 | -all files to be extracted as text, regardless of the supposed file type. |
368 | -On VMS, see also \fB\-S\fP. |
369 | -.TP |
370 | -.B \-b |
371 | -[general] treat all files as binary (no text conversions). This is a shortcut |
372 | -for \fB\-\-\-a\fP. |
373 | -.TP |
374 | -.B \-b |
375 | -[Tandem] force the creation files with filecode type 180 ('C') when |
376 | -extracting Zip entries marked as "text". (On Tandem, \fB\-a\fP is enabled |
377 | -by default, see above). |
378 | -.TP |
379 | -.B \-b |
380 | -[VMS] auto-convert binary files (see \fB\-a\fP above) to fixed-length, |
381 | -512-byte record format. Doubling the option (\fB\-bb\fP) forces all files |
382 | -to be extracted in this format. When extracting to standard output |
383 | -(\fB\-c\fP or \fB\-p\fP option in effect), the default conversion of text |
384 | -record delimiters is disabled for binary (\fB\-b\fP) resp. all (\fB\-bb\fP) |
385 | -files. |
386 | -.TP |
387 | -.B \-B |
388 | -[when compiled with UNIXBACKUP defined] save a backup copy of each |
389 | -overwritten file. The backup file is gets the name of the target file with |
390 | -a tilde and optionally a unique sequence number (up to 5 digits) appended. |
391 | -The sequence number is applied whenever another file with the original name |
392 | -plus tilde already exists. When used together with the "overwrite all" |
393 | -option \fB\-o\fP, numbered backup files are never created. In this case, |
394 | -all backup files are named as the original file with an appended tilde, |
395 | -existing backup files are deleted without notice. |
396 | -This feature works similarly to the default behavior of \fIemacs\fP(1) |
397 | -in many locations. |
398 | -.IP |
399 | -Example: the old copy of ``\fCfoo\fR'' is renamed to ``\fCfoo~\fR''. |
400 | -.IP |
401 | -Warning: Users should be aware that the \fB-B\fP option does not prevent |
402 | -loss of existing data under all circumstances. For example, when |
403 | -\fIunzip\fP is run in overwrite-all mode, an existing ``\fCfoo~\fR'' file |
404 | -is deleted before \fIunzip\fP attempts to rename ``\fCfoo\fR'' to |
405 | -``\fCfoo~\fR''. When this rename attempt fails (because of a file locks, |
406 | -insufficient privileges, or ...), the extraction of ``\fCfoo~\fR'' gets |
407 | -cancelled, but the old backup file is already lost. A similar scenario |
408 | -takes place when the sequence number range for numbered backup files gets |
409 | -exhausted (99999, or 65535 for 16-bit systems). In this case, the backup |
410 | -file with the maximum sequence number is deleted and replaced by the new |
411 | -backup version without notice. |
412 | -.TP |
413 | -.B \-C |
414 | -use case-insensitive matching for the selection of archive entries |
415 | -from the command-line list of extract selection patterns. |
416 | -\fIunzip\fP's philosophy is ``you get what you ask for'' (this is |
417 | -also responsible for the \fB\-L\fP/\fB\-U\fP change; see the relevant |
418 | -options below). Because some file systems are fully case-sensitive |
419 | -(notably those under the Unix operating system) and because |
420 | -both ZIP archives and \fIunzip\fP itself are portable across platforms, |
421 | -\fIunzip\fP's default behavior is to match both wildcard and literal |
422 | -filenames case-sensitively. That is, specifying ``\fCmakefile\fR'' |
423 | -on the command line will \fIonly\fP match ``makefile'' in the archive, |
424 | -not ``Makefile'' or ``MAKEFILE'' (and similarly for wildcard specifications). |
425 | -Since this does not correspond to the behavior of many other |
426 | -operating/file systems (for example, OS/2 HPFS, which preserves |
427 | -mixed case but is not sensitive to it), the \fB\-C\fP option may be |
428 | -used to force all filename matches to be case-insensitive. In the |
429 | -example above, all three files would then match ``\fCmakefile\fR'' |
430 | -(or ``\fCmake*\fR'', or similar). The \fB\-C\fP option affects |
431 | -file specs in both the normal file list and the excluded-file list (xlist). |
432 | -.IP |
433 | -Please note that the \fB\-C\fP option does neither affect the search for |
434 | -the zipfile(s) nor the matching of archive entries to existing files on |
435 | -the extraction path. On a case-sensitive file system, \fIunzip\fP will |
436 | -never try to overwrite a file ``FOO'' when extracting an entry ``foo''! |
437 | -.TP |
438 | -.B \-D |
439 | -skip restoration of timestamps for extracted items. Normally, \fIunzip\fP |
440 | -tries to restore all meta-information for extracted items that are supplied |
441 | -in the Zip archive (and do not require privileges or impose a security risk). |
442 | -By specifying \fB\-D\fP, \fIunzip\fP is told to suppress restoration of |
443 | -timestamps for directories explicitly created from Zip archive entries. |
444 | -This option only applies to ports that support setting timestamps for |
445 | -directories (currently ATheOS, BeOS, MacOS, OS/2, Unix, VMS, Win32, for other |
446 | -\fIunzip\fP ports, \fB\-D\fP has no effect). |
447 | -The duplicated option \fB\-DD\fP forces suppression of timestamp restoration |
448 | -for all extracted entries (files and directories). This option results in |
449 | -setting the timestamps for all extracted entries to the current time. |
450 | -.IP |
451 | -On VMS, the default setting for this option is \fB\-D\fP for consistency |
452 | -with the behaviour of BACKUP: file timestamps are restored, timestamps of |
453 | -extracted directories are left at the current time. To enable restoration |
454 | -of directory timestamps, the negated option \fB\--D\fP should be specified. |
455 | -On VMS, the option \fB\-D\fP disables timestamp restoration for all extracted |
456 | -Zip archive items. (Here, a single \fB\-D\fP on the command line combines |
457 | -with the default \fB\-D\fP to do what an explicit \fB\-DD\fP does on other |
458 | -systems.) |
459 | -.TP |
460 | -.B \-E |
461 | -[MacOS only] display contents of MacOS extra field during restore operation. |
462 | -.TP |
463 | -.B \-F |
464 | -[Acorn only] suppress removal of NFS filetype extension from stored filenames. |
465 | -.TP |
466 | -.B \-F |
467 | -[non-Acorn systems supporting long filenames with embedded commas, |
468 | -and only if compiled with ACORN_FTYPE_NFS defined] translate |
469 | -filetype information from ACORN RISC OS extra field blocks into a |
470 | -NFS filetype extension and append it to the names of the extracted files. |
471 | -(When the stored filename appears to already have an appended NFS filetype |
472 | -extension, it is replaced by the info from the extra field.) |
473 | -.TP |
474 | -.B \-i |
475 | -[MacOS only] ignore filenames stored in MacOS extra fields. Instead, the |
476 | -most compatible filename stored in the generic part of the entry's header |
477 | -is used. |
478 | -.TP |
479 | -.B \-j |
480 | -junk paths. The archive's directory structure is not recreated; all files |
481 | -are deposited in the extraction directory (by default, the current one). |
482 | -.TP |
483 | -.B \-J |
484 | -[BeOS only] junk file attributes. The file's BeOS file attributes are not |
485 | -restored, just the file's data. |
486 | -.TP |
487 | -.B \-J |
488 | -[MacOS only] ignore MacOS extra fields. All Macintosh specific info |
489 | -is skipped. Data-fork and resource-fork are restored as separate files. |
490 | -.TP |
491 | -.B \-K |
492 | -[AtheOS, BeOS, Unix only] retain SUID/SGID/Tacky file attributes. Without |
493 | -this flag, these attribute bits are cleared for security reasons. |
494 | -.TP |
495 | -.B \-L |
496 | -convert to lowercase any filename originating on an uppercase-only operating |
497 | -system or file system. (This was \fIunzip\fP's default behavior in releases |
498 | -prior to 5.11; the new default behavior is identical to the old behavior with |
499 | -the \fB\-U\fP option, which is now obsolete and will be removed in a future |
500 | -release.) Depending on the archiver, files archived under single-case |
501 | -file systems (VMS, old MS-DOS FAT, etc.) may be stored as all-uppercase names; |
502 | -this can be ugly or inconvenient when extracting to a case-preserving |
503 | -file system such as OS/2 HPFS or a case-sensitive one such as under |
504 | -Unix. By default \fIunzip\fP lists and extracts such filenames exactly as |
505 | -they're stored (excepting truncation, conversion of unsupported characters, |
506 | -etc.); this option causes the names of all files from certain systems to be |
507 | -converted to lowercase. The \fB\-LL\fP option forces conversion of every |
508 | -filename to lowercase, regardless of the originating file system. |
509 | -.TP |
510 | -.B \-M |
511 | -pipe all output through an internal pager similar to the Unix \fImore\fP(1) |
512 | -command. At the end of a screenful of output, \fIunzip\fP pauses with a |
513 | -``\-\-More\-\-'' prompt; the next screenful may be viewed by pressing the |
514 | -Enter (Return) key or the space bar. \fIunzip\fP can be terminated by |
515 | -pressing the ``q'' key and, on some systems, the Enter/Return key. Unlike |
516 | -Unix \fImore\fP(1), there is no forward-searching or editing capability. |
517 | -Also, \fIunzip\fP doesn't notice if long lines wrap at the edge of the screen, |
518 | -effectively resulting in the printing of two or more lines and the likelihood |
519 | -that some text will scroll off the top of the screen before being viewed. |
520 | -On some systems the number of available lines on the screen is not detected, |
521 | -in which case \fIunzip\fP assumes the height is 24 lines. |
522 | -.TP |
523 | -.B \-n |
524 | -never overwrite existing files. If a file already exists, skip the extraction |
525 | -of that file without prompting. By default \fIunzip\fP queries before |
526 | -extracting any file that already exists; the user may choose to overwrite |
527 | -only the current file, overwrite all files, skip extraction of the current |
528 | -file, skip extraction of all existing files, or rename the current file. |
529 | -.TP |
530 | -.B \-N |
531 | -[Amiga] extract file comments as Amiga filenotes. File comments are created |
532 | -with the \-c option of \fIzip\fP(1L), or with the \-N option of the Amiga port |
533 | -of \fIzip\fP(1L), which stores filenotes as comments. |
534 | -.TP |
535 | -.B \-o |
536 | -overwrite existing files without prompting. This is a dangerous option, so |
537 | -use it with care. (It is often used with \fB\-f\fP, however, and is the only |
538 | -way to overwrite directory EAs under OS/2.) |
539 | -.IP \fB\-P\fP\ \fIpassword\fP |
540 | -use \fIpassword\fP to decrypt encrypted zipfile entries (if any). \fBTHIS IS |
541 | -INSECURE!\fP Many multi-user operating systems provide ways for any user to |
542 | -see the current command line of any other user; even on stand-alone systems |
543 | -there is always the threat of over-the-shoulder peeking. Storing the plaintext |
544 | -password as part of a command line in an automated script is even worse. |
545 | -Whenever possible, use the non-echoing, interactive prompt to enter passwords. |
546 | -(And where security is truly important, use strong encryption such as Pretty |
547 | -Good Privacy instead of the relatively weak encryption provided by standard |
548 | -zipfile utilities.) |
549 | -.TP |
550 | -.B \-q |
551 | -perform operations quietly (\fB\-qq\fP = even quieter). Ordinarily \fIunzip\fP |
552 | -prints the names of the files it's extracting or testing, the extraction |
553 | -methods, any file or zipfile comments that may be stored in the archive, |
554 | -and possibly a summary when finished with each archive. The \fB\-q\fP[\fBq\fP] |
555 | -options suppress the printing of some or all of these messages. |
556 | -.TP |
557 | -.B \-s |
558 | -[OS/2, NT, MS-DOS] convert spaces in filenames to underscores. Since all PC |
559 | -operating systems allow spaces in filenames, \fIunzip\fP by default extracts |
560 | -filenames with spaces intact (e.g., ``\fCEA\ DATA.\ SF\fR''). This can be |
561 | -awkward, however, since MS-DOS in particular does not gracefully support |
562 | -spaces in filenames. Conversion of spaces to underscores can eliminate the |
563 | -awkwardness in some cases. |
564 | -.TP |
565 | -.B \-S |
566 | -[VMS] convert text files (\fB\-a\fP, \fB\-aa\fP) into Stream_LF record format, |
567 | -instead of the text-file default, variable-length record format. |
568 | -(Stream_LF is the default record format of VMS \fIunzip\fP. It is applied |
569 | -unless conversion (\fB\-a\fP, \fB\-aa\fP and/or \fB\-b\fP, \fB\-bb\fP) is |
570 | -requested or a VMS-specific entry is processed.) |
571 | -.TP |
572 | -.B \-U |
573 | -[UNICODE_SUPPORT only] modify or disable UTF-8 handling. |
574 | -When UNICODE_SUPPORT is available, the option \fB\-U\fP forces \fIunzip\fP |
575 | -to escape all non-ASCII characters from UTF-8 coded filenames as ``#Uxxxx'' |
576 | -(for UCS-2 characters, or ``#Lxxxxxx'' for unicode codepoints needing 3 |
577 | -octets). This option is mainly provided for debugging purpose when the |
578 | -fairly new UTF-8 support is suspected to mangle up extracted filenames. |
579 | -.IP |
580 | -The option \fB\-UU\fP allows to entirely disable the recognition of UTF-8 |
581 | -encoded filenames. The handling of filename codings within \fIunzip\fP falls |
582 | -back to the behaviour of previous versions. |
583 | -.IP |
584 | -[old, obsolete usage] leave filenames uppercase if |
585 | -created under MS-DOS, VMS, etc. See \fB\-L\fP above. |
586 | -.TP |
587 | -.B \-V |
588 | -retain (VMS) file version numbers. VMS files can be stored with a version |
589 | -number, in the format \fCfile.ext;##\fR. By default the ``\fC;##\fR'' version |
590 | -numbers are stripped, but this option allows them to be retained. (On |
591 | -file systems that limit filenames to particularly short lengths, the version |
592 | -numbers may be truncated or stripped regardless of this option.) |
593 | -.TP |
594 | -.B \-W |
595 | -[only when WILD_STOP_AT_DIR compile-time option enabled] |
596 | -modifies the pattern matching routine so that both `?' (single-char wildcard) |
597 | -and `*' (multi-char wildcard) do not match the directory separator character |
598 | -`/'. (The two-character sequence ``**'' acts as a multi-char wildcard that |
599 | -includes the directory separator in its matched characters.) Examples: |
600 | -.PP |
601 | -.EX |
602 | - "*.c" matches "foo.c" but not "mydir/foo.c" |
603 | - "**.c" matches both "foo.c" and "mydir/foo.c" |
604 | - "*/*.c" matches "bar/foo.c" but not "baz/bar/foo.c" |
605 | - "??*/*" matches "ab/foo" and "abc/foo" |
606 | - but not "a/foo" or "a/b/foo" |
607 | -.EE |
608 | -.IP |
609 | -This modified behaviour is equivalent to the pattern matching style |
610 | -used by the shells of some of UnZip's supported target OSs (one |
611 | -example is Acorn RISC OS). This option may not be available on systems |
612 | -where the Zip archive's internal directory separator character `/' is |
613 | -allowed as regular character in native operating system filenames. |
614 | -(Currently, UnZip uses the same pattern matching rules for both wildcard |
615 | -zipfile specifications and zip entry selection patterns in most ports. |
616 | -For systems allowing `/' as regular filename character, the -W option |
617 | -would not work as expected on a wildcard zipfile specification.) |
618 | -.TP |
619 | -.B \-X |
620 | -[VMS, Unix, OS/2, NT, Tandem] restore owner/protection info (UICs and ACL |
621 | -entries) under VMS, or user and group info (UID/GID) under Unix, or access |
622 | -control lists (ACLs) under certain network-enabled versions of OS/2 |
623 | -(Warp Server with IBM LAN Server/Requester 3.0 to 5.0; Warp Connect with |
624 | -IBM Peer 1.0), or security ACLs under Windows NT. In most cases this will |
625 | -require special system privileges, and doubling the option (\fB\-XX\fP) |
626 | -under NT instructs \fIunzip\fP to use privileges for extraction; but under |
627 | -Unix, for example, a user who belongs to several groups can restore files |
628 | -owned by any of those groups, as long as the user IDs match his or her own. |
629 | -Note that ordinary file attributes are always restored--this option applies |
630 | -only to optional, extra ownership info available on some operating systems. |
631 | -[NT's access control lists do not appear to be especially compatible with |
632 | -OS/2's, so no attempt is made at cross-platform portability of access |
633 | -privileges. It is not clear under what conditions this would ever be |
634 | -useful anyway.] |
635 | -.TP |
636 | -.B \-Y |
637 | -[VMS] treat archived file name endings of ``.nnn'' (where ``nnn'' is a |
638 | -decimal number) as if they were VMS version numbers (``;nnn''). |
639 | -(The default is to treat them as file types.) Example: |
640 | -.EX |
641 | - "a.b.3" -> "a.b;3". |
642 | -.EE |
643 | -.TP |
644 | -.B \-$ |
645 | -.\" Amiga support possible eventually, but not yet |
646 | -[MS-DOS, OS/2, NT] restore the volume label if the extraction medium is |
647 | -removable (e.g., a diskette). Doubling the option (\fB\-$$\fP) allows fixed |
648 | -media (hard disks) to be labelled as well. By default, volume labels are |
649 | -ignored. |
650 | -.IP \fB\-/\fP\ \fIextensions\fP |
651 | -[Acorn only] overrides the extension list supplied by Unzip$Ext environment |
652 | -variable. During extraction, filename extensions that match one of the items |
653 | -in this extension list are swapped in front of the base name of the extracted |
654 | -file. |
655 | -.TP |
656 | -.B \-: |
657 | -[all but Acorn, VM/CMS, MVS, Tandem] allows to extract archive members into |
658 | -locations outside of the current `` extraction root folder''. For security |
659 | -reasons, \fIunzip\fP normally removes ``parent dir'' path components |
660 | -(``../'') from the names of extracted file. This safety feature (new for |
661 | -version 5.50) prevents \fIunzip\fP from accidentally writing files to |
662 | -``sensitive'' areas outside the active extraction folder tree head. The |
663 | -\fB\-:\fP option lets \fIunzip\fP switch back to its previous, more liberal |
664 | -behaviour, to allow exact extraction of (older) archives that used ``../'' |
665 | -components to create multiple directory trees at the level of the current |
666 | -extraction folder. This option does not enable writing explicitly to the |
667 | -root directory (``/''). To achieve this, it is necessary to set the |
668 | -extraction target folder to root (e.g. \fB\-d / \fP). However, when the |
669 | -\fB\-:\fP option is specified, it is still possible to implicitly write to |
670 | -the root directory by specifying enough ``../'' path components within the |
671 | -zip archive. |
672 | -Use this option with extreme caution. |
673 | -.TP |
674 | -.B \-^ |
675 | -[Unix only] allow control characters in names of extracted ZIP archive |
676 | -entries. On Unix, a file name may contain any (8-bit) character code with |
677 | -the two exception '/' (directory delimiter) and NUL (0x00, the C string |
678 | -termination indicator), unless the specific file system has more |
679 | -restrictive conventions. Generally, this allows to embed ASCII control |
680 | -characters (or even sophisticated control sequences) in file names, at least |
681 | -on 'native' Unix file systems. However, it may be highly suspicious to |
682 | -make use of this Unix "feature". Embedded control characters in file names |
683 | -might have nasty side effects when displayed on screen by some listing code |
684 | -without sufficient filtering. And, for ordinary users, it may be difficult |
685 | -to handle such file names (e.g. when trying to specify it for open, copy, |
686 | -move, or delete operations). Therefore, \fIunzip\fP applies a filter by |
687 | -default that removes potentially dangerous control characters from the |
688 | -extracted file names. The \fB-^\fP option allows to override this filter |
689 | -in the rare case that embedded filename control characters are to be |
690 | -intentionally restored. |
691 | -.TP |
692 | -.B \-2 |
693 | -[VMS] force unconditionally conversion of file names to ODS2-compatible |
694 | -names. The default is to exploit the destination file system, preserving |
695 | -case and extended file name characters on an ODS5 destination file system; |
696 | -and applying the ODS2-compatibility file name filtering on an ODS2 destination |
697 | -file system. |
698 | -.PD |
699 | -.\" ========================================================================= |
700 | -.SH "ENVIRONMENT OPTIONS" |
701 | -\fIunzip\fP's default behavior may be modified via options placed in |
702 | -an environment variable. This can be done with any option, but it |
703 | -is probably most useful with the \fB\-a\fP, \fB\-L\fP, \fB\-C\fP, \fB\-q\fP, |
704 | -\fB\-o\fP, or \fB\-n\fP modifiers: make \fIunzip\fP auto-convert text |
705 | -files by default, make it convert filenames from uppercase systems to |
706 | -lowercase, make it match names case-insensitively, make it quieter, |
707 | -or make it always overwrite or never overwrite files as it extracts |
708 | -them. For example, to make \fIunzip\fP act as quietly as possible, only |
709 | -reporting errors, one would use one of the following commands: |
710 | -.TP |
711 | - Unix Bourne shell: |
712 | -UNZIP=\-qq; export UNZIP |
713 | -.TP |
714 | - Unix C shell: |
715 | -setenv UNZIP \-qq |
716 | -.TP |
717 | - OS/2 or MS-DOS: |
718 | -set UNZIP=\-qq |
719 | -.TP |
720 | - VMS (quotes for \fIlowercase\fP): |
721 | -define UNZIP_OPTS "\-qq" |
722 | -.PP |
723 | -Environment options are, in effect, considered to be just like any other |
724 | -command-line options, except that they are effectively the first options |
725 | -on the command line. To override an environment option, one may use the |
726 | -``minus operator'' to remove it. For instance, to override one of the |
727 | -quiet-flags in the example above, use the command |
728 | -.PP |
729 | -.EX |
730 | -unzip \-\-q[\fIother options\fP] zipfile |
731 | -.EE |
732 | -.PP |
733 | -The first hyphen is the normal |
734 | -switch character, and the second is a minus sign, acting on the q option. |
735 | -Thus the effect here is to cancel one quantum of quietness. To cancel |
736 | -both quiet flags, two (or more) minuses may be used: |
737 | -.PP |
738 | -.EX |
739 | -unzip \-t\-\-q zipfile |
740 | -unzip \-\-\-qt zipfile |
741 | -.EE |
742 | -.PP |
743 | -(the two are equivalent). This may seem awkward |
744 | -or confusing, but it is reasonably intuitive: just ignore the first |
745 | -hyphen and go from there. It is also consistent with the behavior of |
746 | -Unix \fInice\fP(1). |
747 | -.PP |
748 | -As suggested by the examples above, the default variable names are UNZIP_OPTS |
749 | -for VMS (where the symbol used to install \fIunzip\fP as a foreign command |
750 | -would otherwise be confused with the environment variable), and UNZIP |
751 | -for all other operating systems. For compatibility with \fIzip\fP(1L), |
752 | -UNZIPOPT is also accepted (don't ask). If both UNZIP and UNZIPOPT |
753 | -are defined, however, UNZIP takes precedence. \fIunzip\fP's diagnostic |
754 | -option (\fB\-v\fP with no zipfile name) can be used to check the values |
755 | -of all four possible \fIunzip\fP and \fIzipinfo\fP environment variables. |
756 | -.PP |
757 | -The timezone variable (TZ) should be set according to the local timezone |
758 | -in order for the \fB\-f\fP and \fB\-u\fP to operate correctly. See the |
759 | -description of \fB\-f\fP above for details. This variable may also be |
760 | -necessary to get timestamps of extracted files to be set correctly. |
761 | -The WIN32 (Win9x/ME/NT4/2K/XP/2K3) port of \fIunzip\fP gets the timezone |
762 | -configuration from the registry, assuming it is correctly set in the |
763 | -Control Panel. The TZ variable is ignored for this port. |
764 | -.PD |
765 | -.\" ========================================================================= |
766 | -.SH DECRYPTION |
767 | -Encrypted archives are fully supported by Info-ZIP software, but due to |
768 | -United States export restrictions, de-/encryption support might be disabled |
769 | -in your compiled binary. However, since spring 2000, US export restrictions |
770 | -have been liberated, and our source archives do now include full crypt code. |
771 | -In case you need binary distributions with crypt support enabled, see the |
772 | -file ``WHERE'' in any Info-ZIP source or binary distribution for locations |
773 | -both inside and outside the US. |
774 | -.PP |
775 | -Some compiled versions of \fIunzip\fP may not support decryption. |
776 | -To check a version for crypt support, either attempt to test or extract |
777 | -an encrypted archive, or else check \fIunzip\fP's diagnostic |
778 | -screen (see the \fB\-v\fP option above) for ``\fC[decryption]\fR'' as one |
779 | -of the special compilation options. |
780 | -.PP |
781 | -As noted above, the \fB\-P\fP option may be used to supply a password on |
782 | -the command line, but at a cost in security. The preferred decryption |
783 | -method is simply to extract normally; if a zipfile member is encrypted, |
784 | -\fIunzip\fP will prompt for the password without echoing what is typed. |
785 | -\fIunzip\fP continues to use the same password as long as it appears to be |
786 | -valid, by testing a 12-byte header on each file. The correct password will |
787 | -always check out against the header, but there is a 1-in-256 chance that an |
788 | -incorrect password will as well. (This is a security feature of the PKWARE |
789 | -zipfile format; it helps prevent brute-force attacks that might otherwise |
790 | -gain a large speed advantage by testing only the header.) In the case that |
791 | -an incorrect password is given but it passes the header test anyway, either |
792 | -an incorrect CRC will be generated for the extracted data or else \fIunzip\fP |
793 | -will fail during the extraction because the ``decrypted'' bytes do not |
794 | -constitute a valid compressed data stream. |
795 | -.PP |
796 | -If the first password fails the header check on some file, \fIunzip\fP will |
797 | -prompt for another password, and so on until all files are extracted. If |
798 | -a password is not known, entering a null password (that is, just a carriage |
799 | -return or ``Enter'') is taken as a signal to skip all further prompting. |
800 | -Only unencrypted files in the archive(s) will thereafter be extracted. (In |
801 | -fact, that's not quite true; older versions of \fIzip\fP(1L) and |
802 | -\fIzipcloak\fP(1L) allowed null passwords, so \fIunzip\fP checks each encrypted |
803 | -file to see if the null password works. This may result in ``false positives'' |
804 | -and extraction errors, as noted above.) |
805 | -.PP |
806 | -Archives encrypted with 8-bit passwords (for example, passwords with accented |
807 | -European characters) may not be portable across systems and/or other |
808 | -archivers. This problem stems from the use of multiple encoding methods for |
809 | -such characters, including Latin-1 (ISO 8859-1) and OEM code page 850. |
810 | -DOS \fIPKZIP\fP 2.04g uses the OEM code page; Windows \fIPKZIP\fP 2.50 |
811 | -uses Latin-1 (and is therefore incompatible with DOS \fIPKZIP\fP); Info-ZIP |
812 | -uses the OEM code page on DOS, OS/2 and Win3.x ports but ISO coding |
813 | -(Latin-1 etc.) everywhere else; and Nico Mak's \fIWinZip\fP 6.x does not |
814 | -allow 8-bit passwords at all. \fIUnZip\fP 5.3 (or newer) attempts to use |
815 | -the default character set first (e.g., Latin-1), followed by the alternate |
816 | -one (e.g., OEM code page) to test passwords. On EBCDIC systems, if both |
817 | -of these fail, EBCDIC encoding will be tested as a last resort. (EBCDIC is |
818 | -not tested on non-EBCDIC systems, because there are no known archivers |
819 | -that encrypt using EBCDIC encoding.) ISO character encodings other than |
820 | -Latin-1 are not supported. The new addition of (partially) Unicode (resp. |
821 | -UTF-8) support in \fIUnZip\fP 6.0 has not yet been adapted to the encryption |
822 | -password handling in \fIunzip\fP. On systems that use UTF-8 as native |
823 | -character encoding, \fIunzip\fP simply tries decryption with the native |
824 | -UTF-8 encoded password; the built-in attempts to check the password in |
825 | -translated encoding have not yet been adapted for UTF-8 support and |
826 | -will consequently fail. |
827 | -.PD |
828 | -.\" ========================================================================= |
829 | -.SH EXAMPLES |
830 | -To use \fIunzip\fP to extract all members of the archive \fIletters.zip\fP |
831 | -into the current directory and subdirectories below it, creating any |
832 | -subdirectories as necessary: |
833 | -.PP |
834 | -.EX |
835 | -unzip letters |
836 | -.EE |
837 | -.PP |
838 | -To extract all members of \fIletters.zip\fP into the current directory only: |
839 | -.PP |
840 | -.EX |
841 | -unzip -j letters |
842 | -.EE |
843 | -.PP |
844 | -To test \fIletters.zip\fP, printing only a summary message indicating |
845 | -whether the archive is OK or not: |
846 | -.PP |
847 | -.EX |
848 | -unzip -tq letters |
849 | -.EE |
850 | -.PP |
851 | -To test \fIall\fP zipfiles in the current directory, printing only the |
852 | -summaries: |
853 | -.PP |
854 | -.EX |
855 | -unzip -tq \e*.zip |
856 | -.EE |
857 | -.PP |
858 | -(The backslash before the asterisk is only required if the shell expands |
859 | -wildcards, as in Unix; double quotes could have been used instead, as in |
860 | -the source examples below.)\ \ To extract to standard output all members of |
861 | -\fIletters.zip\fP whose names end in \fI.tex\fP, auto-converting to the |
862 | -local end-of-line convention and piping the output into \fImore\fP(1): |
863 | -.PP |
864 | -.EX |
865 | -unzip \-ca letters \e*.tex | more |
866 | -.EE |
867 | -.PP |
868 | -To extract the binary file \fIpaper1.dvi\fP to standard output and pipe it |
869 | -to a printing program: |
870 | -.PP |
871 | -.EX |
872 | -unzip \-p articles paper1.dvi | dvips |
873 | -.EE |
874 | -.PP |
875 | -To extract all FORTRAN and C source files--*.f, *.c, *.h, and Makefile--into |
876 | -the /tmp directory: |
877 | -.PP |
878 | -.EX |
879 | -unzip source.zip "*.[fch]" Makefile -d /tmp |
880 | -.EE |
881 | -.PP |
882 | -(the double quotes are necessary only in Unix and only if globbing is turned |
883 | -on). To extract all FORTRAN and C source files, regardless of case (e.g., |
884 | -both *.c and *.C, and any makefile, Makefile, MAKEFILE or similar): |
885 | -.PP |
886 | -.EX |
887 | -unzip \-C source.zip "*.[fch]" makefile -d /tmp |
888 | -.EE |
889 | -.PP |
890 | -To extract any such files but convert any uppercase MS-DOS or VMS names to |
891 | -lowercase and convert the line-endings of all of the files to the local |
892 | -standard (without respect to any files that might be marked ``binary''): |
893 | -.PP |
894 | -.EX |
895 | -unzip \-aaCL source.zip "*.[fch]" makefile -d /tmp |
896 | -.EE |
897 | -.PP |
898 | -To extract only newer versions of the files already in the current |
899 | -directory, without querying (NOTE: be careful of unzipping in one timezone a |
900 | -zipfile created in another--ZIP archives other than those created by Zip 2.1 |
901 | -or later contain no timezone information, and a ``newer'' file from an eastern |
902 | -timezone may, in fact, be older): |
903 | -.PP |
904 | -.EX |
905 | -unzip \-fo sources |
906 | -.EE |
907 | -.PP |
908 | -To extract newer versions of the files already in the current directory and |
909 | -to create any files not already there (same caveat as previous example): |
910 | -.PP |
911 | -.EX |
912 | -unzip \-uo sources |
913 | -.EE |
914 | -.PP |
915 | -To display a diagnostic screen showing which \fIunzip\fP and \fIzipinfo\fP |
916 | -options are stored in environment variables, whether decryption support was |
917 | -compiled in, the compiler with which \fIunzip\fP was compiled, etc.: |
918 | -.PP |
919 | -.EX |
920 | -unzip \-v |
921 | -.EE |
922 | -.PP |
923 | -In the last five examples, assume that UNZIP or UNZIP_OPTS is set to -q. |
924 | -To do a singly quiet listing: |
925 | -.PP |
926 | -.EX |
927 | -unzip \-l file.zip |
928 | -.EE |
929 | -.PP |
930 | -To do a doubly quiet listing: |
931 | -.PP |
932 | -.EX |
933 | -unzip \-ql file.zip |
934 | -.EE |
935 | -.PP |
936 | -(Note that the ``\fC.zip\fR'' is generally not necessary.) To do a standard |
937 | -listing: |
938 | -.PP |
939 | -.EX |
940 | -unzip \-\-ql file.zip |
941 | -.EE |
942 | -or |
943 | -.EX |
944 | -unzip \-l\-q file.zip |
945 | -.EE |
946 | -or |
947 | -.EX |
948 | -unzip \-l\-\-q file.zip |
949 | -.EE |
950 | -\fR(Extra minuses in options don't hurt.) |
951 | -.PD |
952 | -.\" ========================================================================= |
953 | -.SH TIPS |
954 | -The current maintainer, being a lazy sort, finds it very useful to define |
955 | -a pair of aliases: \fCtt\fR for ``\fCunzip \-tq\fR'' and \fCii\fR for |
956 | -``\fCunzip \-Z\fR'' (or ``\fCzipinfo\fR''). One may then simply type |
957 | -``\fCtt zipfile\fR'' to test an archive, something that is worth making a |
958 | -habit of doing. With luck \fIunzip\fP will report ``\fCNo errors detected |
959 | -in compressed data of zipfile.zip\fR,'' after which one may breathe a sigh |
960 | -of relief. |
961 | -.PP |
962 | -The maintainer also finds it useful to set the UNZIP environment variable |
963 | -to ``\fC\-aL\fR'' and is tempted to add ``\fC\-C\fR'' as well. His ZIPINFO |
964 | -variable is set to ``\fC\-z\fR''. |
965 | -.PD |
966 | -.\" ========================================================================= |
967 | -.SH DIAGNOSTICS |
968 | -The exit status (or error level) approximates the exit codes defined by PKWARE |
969 | -and takes on the following values, except under VMS: |
970 | -.RS |
971 | -.IP 0 |
972 | -normal; no errors or warnings detected. |
973 | -.IP 1 |
974 | -one or more warning errors were encountered, but processing completed |
975 | -successfully anyway. This includes zipfiles where one or more files |
976 | -was skipped due to unsupported compression method or encryption with an |
977 | -unknown password. |
978 | -.IP 2 |
979 | -a generic error in the zipfile format was detected. Processing may have |
980 | -completed successfully anyway; some broken zipfiles created by other |
981 | -archivers have simple work-arounds. |
982 | -.IP 3 |
983 | -a severe error in the zipfile format was detected. Processing probably |
984 | -failed immediately. |
985 | -.IP 4 |
986 | -\fIunzip\fP was unable to allocate memory for one or more buffers during |
987 | -program initialization. |
988 | -.IP 5 |
989 | -\fIunzip\fP was unable to allocate memory or unable to obtain a tty to read |
990 | -the decryption password(s). |
991 | -.IP 6 |
992 | -\fIunzip\fP was unable to allocate memory during decompression to disk. |
993 | -.IP 7 |
994 | -\fIunzip\fP was unable to allocate memory during in-memory decompression. |
995 | -.IP 8 |
996 | -[currently not used] |
997 | -.IP 9 |
998 | -the specified zipfiles were not found. |
999 | -.IP 10 |
1000 | -invalid options were specified on the command line. |
1001 | -.IP 11 |
1002 | -no matching files were found. |
1003 | -.IP 50 |
1004 | -the disk is (or was) full during extraction. |
1005 | -.IP 51 |
1006 | -the end of the ZIP archive was encountered prematurely. |
1007 | -.IP 80 |
1008 | -the user aborted \fIunzip\fP prematurely with control-C (or similar) |
1009 | -.IP 81 |
1010 | -testing or extraction of one or more files failed due to unsupported |
1011 | -compression methods or unsupported decryption. |
1012 | -.IP 82 |
1013 | -no files were found due to bad decryption password(s). (If even one file is |
1014 | -successfully processed, however, the exit status is 1.) |
1015 | -.RE |
1016 | -.PP |
1017 | -VMS interprets standard Unix (or PC) return values as other, scarier-looking |
1018 | -things, so \fIunzip\fP instead maps them into VMS-style status codes. The |
1019 | -current mapping is as follows: 1 (success) for normal exit, 0x7fff0001 |
1020 | -for warning errors, and (0x7fff000? + 16*normal_unzip_exit_status) for all |
1021 | -other errors, where the `?' is 2 (error) for \fIunzip\fP values 2, 9-11 and |
1022 | -80-82, and 4 (fatal error) for the remaining ones (3-8, 50, 51). In addition, |
1023 | -there is a compilation option to expand upon this behavior: defining |
1024 | -RETURN_CODES results in a human-readable explanation of what the error |
1025 | -status means. |
1026 | -.PD |
1027 | -.\" ========================================================================= |
1028 | -.SH BUGS |
1029 | -Multi-part archives are not yet supported, except in conjunction with |
1030 | -\fIzip\fP. (All parts must be concatenated together in order, and then |
1031 | -``\fCzip \-F\fR'' (for \fIzip 2.x\fP) or ``\fCzip \-FF\fR'' (for |
1032 | -\fIzip 3.x\fP) must be performed on the concatenated archive in order to |
1033 | -``fix'' it. Also, \fIzip 3.0\fP and later can combine multi-part (split) |
1034 | -archives into a combined single-file archive using ``\fCzip \-s\- inarchive |
1035 | --O outarchive\fR''. See the \fIzip 3\fP manual page for more information.) |
1036 | -This will definitely be corrected in the next major release. |
1037 | -.PP |
1038 | -Archives read from standard input are not yet supported, except with |
1039 | -\fIfunzip\fP (and then only the first member of the archive can be extracted). |
1040 | -.PP |
1041 | -Archives encrypted with 8-bit passwords (e.g., passwords with accented |
1042 | -European characters) may not be portable across systems and/or other |
1043 | -archivers. See the discussion in \fBDECRYPTION\fP above. |
1044 | -.PP |
1045 | -\fIunzip\fP's \fB\-M\fP (``more'') option tries to take into account automatic |
1046 | -wrapping of long lines. However, the code may fail to detect the correct |
1047 | -wrapping locations. First, TAB characters (and similar control sequences) are |
1048 | -not taken into account, they are handled as ordinary printable characters. |
1049 | -Second, depending on the actual system / OS port, \fIunzip\fP may not detect |
1050 | -the true screen geometry but rather rely on "commonly used" default dimensions. |
1051 | -The correct handling of tabs would require the implementation of a query for |
1052 | -the actual tabulator setup on the output console. |
1053 | -.PP |
1054 | -Dates, times and permissions of stored directories are not restored except |
1055 | -under Unix. (On Windows NT and successors, timestamps are now restored.) |
1056 | -.PP |
1057 | -[MS-DOS] When extracting or testing files from an archive on a defective |
1058 | -floppy diskette, if the ``Fail'' option is chosen from DOS's ``Abort, Retry, |
1059 | -Fail?'' message, older versions of \fIunzip\fP may hang the system, requiring |
1060 | -a reboot. This problem appears to be fixed, but control-C (or control-Break) |
1061 | -can still be used to terminate \fIunzip\fP. |
1062 | -.PP |
1063 | -Under DEC Ultrix, \fIunzip\fP would sometimes fail on long zipfiles (bad CRC, |
1064 | -not always reproducible). This was apparently due either to a hardware bug |
1065 | -(cache memory) or an operating system bug (improper handling of page faults?). |
1066 | -Since Ultrix has been abandoned in favor of Digital Unix (OSF/1), this may not |
1067 | -be an issue anymore. |
1068 | -.PP |
1069 | -[Unix] Unix special files such as FIFO buffers (named pipes), block devices |
1070 | -and character devices are not restored even if they are somehow represented |
1071 | -in the zipfile, nor are hard-linked files relinked. Basically the only file |
1072 | -types restored by \fIunzip\fP are regular files, directories and symbolic |
1073 | -(soft) links. |
1074 | -.PP |
1075 | -[OS/2] Extended attributes for existing directories are only updated if the |
1076 | -\fB\-o\fP (``overwrite all'') option is given. This is a limitation of the |
1077 | -operating system; because directories only have a creation time associated |
1078 | -with them, \fIunzip\fP has no way to determine whether the stored attributes |
1079 | -are newer or older than those on disk. In practice this may mean a two-pass |
1080 | -approach is required: first unpack the archive normally (with or without |
1081 | -freshening/updating existing files), then overwrite just the directory entries |
1082 | -(e.g., ``\fCunzip -o foo */\fR''). |
1083 | -.PP |
1084 | -[VMS] When extracting to another directory, only the \fI[.foo]\fP syntax is |
1085 | -accepted for the \fB\-d\fP option; the simple Unix \fIfoo\fP syntax is |
1086 | -silently ignored (as is the less common VMS \fIfoo.dir\fP syntax). |
1087 | -.PP |
1088 | -[VMS] When the file being extracted already exists, \fIunzip\fP's query only |
1089 | -allows skipping, overwriting or renaming; there should additionally be a |
1090 | -choice for creating a new version of the file. In fact, the ``overwrite'' |
1091 | -choice does create a new version; the old version is not overwritten or |
1092 | -deleted. |
1093 | -.PD |
1094 | -.\" ========================================================================= |
1095 | -.SH "SEE ALSO" |
1096 | -\fIfunzip\fP(1L), \fIzip\fP(1L), \fIzipcloak\fP(1L), \fIzipgrep\fP(1L), |
1097 | -\fIzipinfo\fP(1L), \fIzipnote\fP(1L), \fIzipsplit\fP(1L) |
1098 | -.PD |
1099 | -.\" ========================================================================= |
1100 | -.SH URL |
1101 | -The Info-ZIP home page is currently at |
1102 | -.EX |
1103 | -\fChttp://www.info-zip.org/pub/infozip/\fR |
1104 | -.EE |
1105 | -or |
1106 | -.EX |
1107 | -\fCftp://ftp.info-zip.org/pub/infozip/\fR . |
1108 | -.EE |
1109 | -.PD |
1110 | -.\" ========================================================================= |
1111 | -.SH AUTHORS |
1112 | -The primary Info-ZIP authors (current semi-active members of the Zip-Bugs |
1113 | -workgroup) are: Ed Gordon (Zip, general maintenance, shared code, Zip64, |
1114 | -Win32, Unix, Unicode); Christian Spieler (UnZip maintenance coordination, |
1115 | -VMS, MS-DOS, Win32, shared code, general Zip and UnZip integration and |
1116 | -optimization); Onno van der Linden (Zip); Mike White (Win32, Windows GUI, |
1117 | -Windows DLLs); Kai Uwe Rommel (OS/2, Win32); Steven M. Schweda (VMS, Unix, |
1118 | -support of new features); Paul Kienitz (Amiga, Win32, Unicode); Chris |
1119 | -Herborth (BeOS, QNX, Atari); Jonathan Hudson (SMS/QDOS); Sergio Monesi |
1120 | -(Acorn RISC OS); Harald Denker (Atari, MVS); John Bush (Solaris, Amiga); |
1121 | -Hunter Goatley (VMS, Info-ZIP Site maintenance); Steve Salisbury (Win32); |
1122 | -Steve Miller (Windows CE GUI), Johnny Lee (MS-DOS, Win32, Zip64); and Dave |
1123 | -Smith (Tandem NSK). |
1124 | -.PP |
1125 | -The following people were former members of the Info-ZIP development group |
1126 | -and provided major contributions to key parts of the current code: |
1127 | -Greg ``Cave Newt'' Roelofs (UnZip, unshrink decompression); |
1128 | -Jean-loup Gailly (deflate compression); |
1129 | -Mark Adler (inflate decompression, fUnZip). |
1130 | -.PP |
1131 | -The author of the original unzip code upon which Info-ZIP's was based |
1132 | -is Samuel H. Smith; Carl Mascott did the first Unix port; and David P. |
1133 | -Kirschbaum organized and led Info-ZIP in its early days with Keith Petersen |
1134 | -hosting the original mailing list at WSMR-SimTel20. The full list of |
1135 | -contributors to UnZip has grown quite large; please refer to the CONTRIBS |
1136 | -file in the UnZip source distribution for a relatively complete version. |
1137 | -.PD |
1138 | -.\" ========================================================================= |
1139 | -.SH VERSIONS |
1140 | -.ta \w'vx.xxnn'u +\w'fall 1989'u+3n |
1141 | -.PD 0 |
1142 | -.IP "v1.2\t15 Mar 89" \w'\t\t'u |
1143 | -Samuel H. Smith |
1144 | -.IP "v2.0\t\ 9 Sep 89" |
1145 | -Samuel H. Smith |
1146 | -.IP "v2.x\tfall 1989" |
1147 | -many Usenet contributors |
1148 | -.IP "v3.0\t\ 1 May 90" |
1149 | -Info-ZIP (DPK, consolidator) |
1150 | -.IP "v3.1\t15 Aug 90" |
1151 | -Info-ZIP (DPK, consolidator) |
1152 | -.IP "v4.0\t\ 1 Dec 90" |
1153 | -Info-ZIP (GRR, maintainer) |
1154 | -.IP "v4.1\t12 May 91" |
1155 | -Info-ZIP |
1156 | -.IP "v4.2\t20 Mar 92" |
1157 | -Info-ZIP (Zip-Bugs subgroup, GRR) |
1158 | -.IP "v5.0\t21 Aug 92" |
1159 | -Info-ZIP (Zip-Bugs subgroup, GRR) |
1160 | -.IP "v5.01\t15 Jan 93" |
1161 | -Info-ZIP (Zip-Bugs subgroup, GRR) |
1162 | -.IP "v5.1\t\ 7 Feb 94" |
1163 | -Info-ZIP (Zip-Bugs subgroup, GRR) |
1164 | -.IP "v5.11\t\ 2 Aug 94" |
1165 | -Info-ZIP (Zip-Bugs subgroup, GRR) |
1166 | -.IP "v5.12\t28 Aug 94" |
1167 | -Info-ZIP (Zip-Bugs subgroup, GRR) |
1168 | -.IP "v5.2\t30 Apr 96" |
1169 | -Info-ZIP (Zip-Bugs subgroup, GRR) |
1170 | -.IP "v5.3\t22 Apr 97" |
1171 | -Info-ZIP (Zip-Bugs subgroup, GRR) |
1172 | -.IP "v5.31\t31 May 97" |
1173 | -Info-ZIP (Zip-Bugs subgroup, GRR) |
1174 | -.IP "v5.32\t\ 3 Nov 97" |
1175 | -Info-ZIP (Zip-Bugs subgroup, GRR) |
1176 | -.IP "v5.4\t28 Nov 98" |
1177 | -Info-ZIP (Zip-Bugs subgroup, SPC) |
1178 | -.IP "v5.41\t16 Apr 00" |
1179 | -Info-ZIP (Zip-Bugs subgroup, SPC) |
1180 | -.IP "v5.42\t14 Jan 01" |
1181 | -Info-ZIP (Zip-Bugs subgroup, SPC) |
1182 | -.IP "v5.5\t17 Feb 02" |
1183 | -Info-ZIP (Zip-Bugs subgroup, SPC) |
1184 | -.IP "v5.51\t22 May 04" |
1185 | -Info-ZIP (Zip-Bugs subgroup, SPC) |
1186 | -.IP "v5.52\t28 Feb 05" |
1187 | -Info-ZIP (Zip-Bugs subgroup, SPC) |
1188 | -.IP "v6.0\t20 Apr 09" |
1189 | -Info-ZIP (Zip-Bugs subgroup, SPC) |
1190 | -.PD |
1191 | |
1192 | === removed file '.pc/01-manpages-in-section-1-not-in-section-1l/man/unzipsfx.1' |
1193 | --- .pc/01-manpages-in-section-1-not-in-section-1l/man/unzipsfx.1 2010-02-21 17:01:00 +0000 |
1194 | +++ .pc/01-manpages-in-section-1-not-in-section-1l/man/unzipsfx.1 1970-01-01 00:00:00 +0000 |
1195 | @@ -1,336 +0,0 @@ |
1196 | -.\" Copyright (c) 1990-2009 Info-ZIP. All rights reserved. |
1197 | -.\" |
1198 | -.\" See the accompanying file LICENSE, version 2009-Jan-02 or later |
1199 | -.\" (the contents of which are also included in unzip.h) for terms of use. |
1200 | -.\" If, for some reason, all these files are missing, the Info-ZIP license |
1201 | -.\" also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html |
1202 | -.\" |
1203 | -.\" unzipsfx.1 by Greg Roelofs |
1204 | -.\" |
1205 | -.\" ========================================================================= |
1206 | -.\" define .EX/.EE (for multiline user-command examples; normal Courier font) |
1207 | -.de EX |
1208 | -.in +4n |
1209 | -.nf |
1210 | -.ft CW |
1211 | -.. |
1212 | -.de EE |
1213 | -.ft R |
1214 | -.fi |
1215 | -.in -4n |
1216 | -.. |
1217 | -.\" ========================================================================= |
1218 | -.TH UNZIPSFX 1L "20 April 2009 (v6.0)" "Info-ZIP" |
1219 | -.SH NAME |
1220 | -unzipsfx \- self-extracting stub for prepending to ZIP archives |
1221 | -.PD |
1222 | -.SH SYNOPSIS |
1223 | -\fB<name of unzipsfx+archive combo>\fP [\fB\-cfptuz\fP[\fBajnoqsCLV$\fP]] |
1224 | -[\fIfile(s)\fP\ .\|.\|. [\fB\-x\fP\ \fIxfile(s)\fP\ .\|.\|.]] |
1225 | -.PD |
1226 | -.\" ========================================================================= |
1227 | -.SH DESCRIPTION |
1228 | -\fIunzipsfx\fP is a modified version of \fIunzip\fP(1L) designed to be |
1229 | -prepended to existing ZIP archives in order to form self-extracting archives. |
1230 | -Instead of taking its first non-flag argument to be the zipfile(s) to be |
1231 | -extracted, \fIunzipsfx\fP seeks itself under the name by which it was invoked |
1232 | -and tests or extracts the contents of the appended archive. Because the |
1233 | -executable stub adds bulk to the archive (the whole purpose of which is to |
1234 | -be as small as possible), a number of the less-vital capabilities in regular |
1235 | -\fIunzip\fP have been removed. Among these are the usage (or help) screen, |
1236 | -the listing and diagnostic functions (\fB\-l\fP and \fB\-v\fP), the ability |
1237 | -to decompress older compression formats (the ``reduce,'' ``shrink'' and |
1238 | -``implode'' methods). The ability to extract to a directory other than |
1239 | -the current one can be selected as a compile-time option, which is now enabled |
1240 | -by default since UnZipSFX version 5.5. Similarly, decryption is supported as |
1241 | -a compile-time option but should be avoided unless the attached archive |
1242 | -contains encrypted files. Starting with release 5.5, another compile-time |
1243 | -option adds a simple ``run command after extraction'' feature. This feature |
1244 | -is currently incompatible with the ``extract to different directory'' |
1245 | -feature and remains disabled by default. |
1246 | -.PP |
1247 | -\fBNote that |
1248 | -self-extracting archives made with\fP \fIunzipsfx\fP \fBare no more (or less) |
1249 | -portable across different operating systems than is |
1250 | -the\fP \fIunzip\fP \fBexecutable itself.\fP In general a self-extracting |
1251 | -archive made on |
1252 | -a particular Unix system, for example, will only self-extract under the same |
1253 | -flavor of Unix. Regular \fIunzip\fP may still be used to extract the |
1254 | -embedded archive as with any normal zipfile, although it will generate |
1255 | -a harmless warning about extra bytes at the beginning of the zipfile. |
1256 | -\fIDespite this\fP, however, the self-extracting archive is technically |
1257 | -\fInot\fP a valid ZIP archive, and PKUNZIP may be unable to test or extract |
1258 | -it. This limitation is due to the simplistic manner in which the archive |
1259 | -is created; the internal directory structure is not updated to reflect the |
1260 | -extra bytes prepended to the original zipfile. |
1261 | -.PD |
1262 | -.\" ========================================================================= |
1263 | -.SH ARGUMENTS |
1264 | -.IP [\fIfile(s)\fP] |
1265 | -An optional list of archive members to be processed. |
1266 | -Regular expressions (wildcards) similar to those in Unix \fIegrep\fP(1) |
1267 | -may be used to match multiple members. These wildcards may contain: |
1268 | -.RS |
1269 | -.IP * |
1270 | -matches a sequence of 0 or more characters |
1271 | -.IP ? |
1272 | -matches exactly 1 character |
1273 | -.IP [.\|.\|.] |
1274 | -matches any single character found inside the brackets; ranges are specified |
1275 | -by a beginning character, a hyphen, and an ending character. If an exclamation |
1276 | -point or a caret (`!' or `^') follows the left bracket, then the range of |
1277 | -characters within the brackets is complemented (that is, anything \fIexcept\fP |
1278 | -the characters inside the brackets is considered a match). |
1279 | -.RE |
1280 | -.IP |
1281 | -(Be sure to quote any character that might otherwise be interpreted or |
1282 | -modified by the operating system, particularly under Unix and VMS.) |
1283 | -.IP [\fB\-x\fP\ \fIxfile(s)\fP] |
1284 | -An optional list of archive members to be excluded from processing. |
1285 | -Since wildcard characters match directory separators (`/'), this option |
1286 | -may be used to exclude any files that are in subdirectories. For |
1287 | -example, ``\fCfoosfx *.[ch] -x */*\fR'' would extract all C source files |
1288 | -in the main directory, but none in any subdirectories. Without the \fB\-x\fP |
1289 | -option, all C source files in all directories within the zipfile would be |
1290 | -extracted. |
1291 | -.PP |
1292 | -If \fIunzipsfx\fP is compiled with SFX_EXDIR defined, the following option |
1293 | -is also enabled: |
1294 | -.IP [\fB\-d\fP\ \fIexdir\fP] |
1295 | -An optional directory to which to extract files. By default, all files |
1296 | -and subdirectories are recreated in the current directory; the \fB\-d\fP |
1297 | -option allows extraction in an arbitrary directory (always assuming one |
1298 | -has permission to write to the directory). The option and directory may |
1299 | -be concatenated without any white space between them, but note that this |
1300 | -may cause normal shell behavior to be suppressed. In particular, |
1301 | -``\fC\-d\ ~\fR'' (tilde) is expanded by Unix C shells into the name |
1302 | -of the user's home directory, but ``\fC\-d~\fR'' is treated as a |
1303 | -literal subdirectory ``\fB~\fP'' of the current directory. |
1304 | -.PD |
1305 | -.\" ========================================================================= |
1306 | -.SH OPTIONS |
1307 | -\fIunzipsfx\fP supports the following \fIunzip\fP(1L) options: \fB\-c\fP |
1308 | -and \fB\-p\fP (extract to standard output/screen), \fB\-f\fP and \fB\-u\fP |
1309 | -(freshen and update existing files upon extraction), \fB\-t\fP (test |
1310 | -archive) and \fB\-z\fP (print archive comment). All normal listing options |
1311 | -(\fB\-l\fP, \fB\-v\fP and \fB\-Z\fP) have been removed, but the testing |
1312 | -option (\fB\-t\fP) may be used as a ``poor man's'' listing. Alternatively, |
1313 | -those creating self-extracting archives may wish to include a short listing |
1314 | -in the zipfile comment. |
1315 | -.PP |
1316 | -See \fIunzip\fP(1L) for a more complete description of these options. |
1317 | -.PD |
1318 | -.\" ========================================================================= |
1319 | -.SH MODIFIERS |
1320 | -\fIunzipsfx\fP currently supports all \fIunzip\fP(1L) modifiers: \fB\-a\fP |
1321 | -(convert text files), \fB\-n\fP (never overwrite), \fB\-o\fP (overwrite |
1322 | -without prompting), \fB\-q\fP (operate quietly), \fB\-C\fP (match names |
1323 | -case-insensitively), \fB\-L\fP (convert uppercase-OS names to lowercase), |
1324 | -\fB\-j\fP (junk paths) and \fB\-V\fP (retain version numbers); plus the |
1325 | -following operating-system specific options: \fB\-X\fP (restore VMS |
1326 | -owner/protection info), \fB\-s\fP (convert spaces in filenames to underscores |
1327 | -[DOS, OS/2, NT]) and \fB\-$\fP (restore volume label [DOS, OS/2, NT, Amiga]). |
1328 | -.PP |
1329 | -(Support for regular ASCII text-conversion may be removed in future versions, |
1330 | -since it is simple enough for the archive's creator to ensure that text |
1331 | -files have the appropriate format for the local OS. EBCDIC conversion will |
1332 | -of course continue to be supported since the zipfile format implies ASCII |
1333 | -storage of text files.) |
1334 | -.PP |
1335 | -See \fIunzip\fP(1L) for a more complete description of these modifiers. |
1336 | -.PD |
1337 | -.\" ========================================================================= |
1338 | -.SH "ENVIRONMENT OPTIONS" |
1339 | -\fIunzipsfx\fP uses the same environment variables as \fIunzip\fP(1L) does, |
1340 | -although this is likely to be an issue only for the person creating and |
1341 | -testing the self-extracting archive. See \fIunzip\fP(1L) for details. |
1342 | -.PD |
1343 | -.\" ========================================================================= |
1344 | -.SH DECRYPTION |
1345 | -Decryption is supported exactly as in \fIunzip\fP(1L); that is, interactively |
1346 | -with a non-echoing prompt for the password(s). See \fIunzip\fP(1L) for |
1347 | -details. Once again, note that if the archive has no encrypted files there |
1348 | -is no reason to use a version of \fIunzipsfx\fP with decryption support; |
1349 | -that only adds to the size of the archive. |
1350 | -.PD |
1351 | -.\" ========================================================================= |
1352 | -.SH AUTORUN COMMAND |
1353 | -When \fIunzipsfx\fP was compiled with CHEAP_SFX_AUTORUN defined, a simple |
1354 | -``command autorun'' feature is supported. You may enter a command into the |
1355 | -Zip archive comment, using the following format: |
1356 | -.PP |
1357 | -.EX |
1358 | -$AUTORUN$>[command line string] |
1359 | -.EE |
1360 | -.PP |
1361 | -When \fIunzipsfx\fP recognizes the ``$AUTORUN$>'' token at the beginning |
1362 | -of the Zip archive comment, the remainder of the first line of the comment |
1363 | -(until the first newline character) is passed as a shell command to the |
1364 | -operating system using the C rtl ``system'' function. Before executing |
1365 | -the command, \fIunzipsfx\fP displays the command on the console and prompts |
1366 | -the user for confirmation. When the user has switched off prompting by |
1367 | -specifying the \fB-q\fP option, autorun commands are never executed. |
1368 | -.PP |
1369 | -In case the archive comment contains additional lines of text, the remainder |
1370 | -of the archive comment following the first line is displayed normally, unless |
1371 | -quiet operation was requested by supplying a \fB-q\fP option. |
1372 | -.PD |
1373 | -.\" ========================================================================= |
1374 | -.SH EXAMPLES |
1375 | -To create a self-extracting archive \fIletters\fP from a regular zipfile |
1376 | -\fIletters.zip\fP and change the new archive's permissions to be |
1377 | -world-executable under Unix: |
1378 | -.PP |
1379 | -.EX |
1380 | -cat unzipsfx letters.zip > letters |
1381 | -chmod 755 letters |
1382 | -zip -A letters |
1383 | -.EE |
1384 | -.PP |
1385 | -To create the same archive under MS-DOS, OS/2 or NT (note the use of the |
1386 | -\fB/b\fP [binary] option to the \fIcopy\fP command): |
1387 | -.PP |
1388 | -.EX |
1389 | -copy /b unzipsfx.exe+letters.zip letters.exe |
1390 | -zip -A letters.exe |
1391 | -.EE |
1392 | -.PP |
1393 | -Under VMS: |
1394 | -.PP |
1395 | -.EX |
1396 | -copy unzipsfx.exe,letters.zip letters.exe |
1397 | -letters == "$currentdisk:[currentdir]letters.exe" |
1398 | -zip -A letters.exe |
1399 | -.EE |
1400 | -.PP |
1401 | -(The VMS \fIappend\fP command may also be used. The second command installs |
1402 | -the new program as a ``foreign command'' capable of taking arguments. The |
1403 | -third line assumes that Zip is already installed as a foreign command.) |
1404 | -Under AmigaDOS: |
1405 | -.PP |
1406 | -.EX |
1407 | -MakeSFX letters letters.zip UnZipSFX |
1408 | -.EE |
1409 | -.PP |
1410 | -(MakeSFX is included with the UnZip source distribution and with Amiga |
1411 | -binary distributions. ``\fCzip -A\fR'' doesn't work on Amiga self-extracting |
1412 | -archives.) |
1413 | -To test (or list) the newly created self-extracting archive: |
1414 | -.PP |
1415 | -.EX |
1416 | -letters \-t |
1417 | -.EE |
1418 | -.PP |
1419 | -To test \fIletters\fP quietly, printing only a summary message indicating |
1420 | -whether the archive is OK or not: |
1421 | -.PP |
1422 | -.EX |
1423 | -letters \-tqq |
1424 | -.EE |
1425 | -.PP |
1426 | -To extract the complete contents into the current directory, recreating all |
1427 | -files and subdirectories as necessary: |
1428 | -.PP |
1429 | -.EX |
1430 | -letters |
1431 | -.EE |
1432 | -.PP |
1433 | -To extract all \fC*.txt\fR files (in Unix quote the `*'): |
1434 | -.PP |
1435 | -.EX |
1436 | -letters *.txt |
1437 | -.EE |
1438 | -.PP |
1439 | -To extract everything \fIexcept\fP the \fC*.txt\fR files: |
1440 | -.PP |
1441 | -.EX |
1442 | -letters -x *.txt |
1443 | -.EE |
1444 | -.PP |
1445 | -To extract only the README file to standard output (the screen): |
1446 | -.PP |
1447 | -.EX |
1448 | -letters -c README |
1449 | -.EE |
1450 | -.PP |
1451 | -To print only the zipfile comment: |
1452 | -.PP |
1453 | -.EX |
1454 | -letters \-z |
1455 | -.EE |
1456 | -.PD |
1457 | -.\" ========================================================================= |
1458 | -.SH LIMITATIONS |
1459 | -The principle and fundamental limitation of \fIunzipsfx\fP is that it is |
1460 | -not portable across architectures or operating systems, and therefore |
1461 | -neither are the resulting archives. For some architectures there is |
1462 | -limited portability, however (e.g., between some flavors of Intel-based Unix). |
1463 | -.PP |
1464 | -Another problem with the current implementation is that any archive |
1465 | -with ``junk'' prepended to the beginning technically is no longer a zipfile |
1466 | -(unless \fIzip\fP(1) is used to adjust the zipfile offsets appropriately, |
1467 | -as noted above). \fIunzip\fP(1) takes note of the prepended bytes |
1468 | -and ignores them since some file-transfer protocols, notably MacBinary, are |
1469 | -also known to prepend junk. But PKWARE's archiver suite may not be able to |
1470 | -deal with the modified archive unless its offsets have been adjusted. |
1471 | -.PP |
1472 | -\fIunzipsfx\fP has no knowledge of the user's PATH, so in general an archive |
1473 | -must either be in the current directory when it is invoked, or else a full |
1474 | -or relative path must be given. If a user attempts to extract the archive |
1475 | -from a directory in the PATH other than the current one, \fIunzipsfx\fP will |
1476 | -print a warning to the effect, ``can't find myself.'' This is always true |
1477 | -under Unix and may be true in some cases under MS-DOS, depending on the |
1478 | -compiler used (Microsoft C fully qualifies the program name, but other |
1479 | -compilers may not). Under OS/2 and NT there are operating-system calls |
1480 | -available that provide the full path name, so the archive may be invoked |
1481 | -from anywhere in the user's path. The situation is not known for AmigaDOS, |
1482 | -Atari TOS, MacOS, etc. |
1483 | -.PP |
1484 | -As noted above, a number of the normal \fIunzip\fP(1L) functions have |
1485 | -been removed in order to make \fIunzipsfx\fP smaller: usage and diagnostic |
1486 | -info, listing functions and extraction to other directories. Also, only |
1487 | -stored and deflated files are supported. The latter limitation is mainly |
1488 | -relevant to those who create SFX archives, however. |
1489 | -.PP |
1490 | -VMS users must know how to set up self-extracting archives as foreign |
1491 | -commands in order to use any of \fIunzipsfx\fP's options. This is not |
1492 | -necessary for simple extraction, but the command to do so then becomes, |
1493 | -e.g., ``\fCrun letters\fR'' (to continue the examples given above). |
1494 | -.PP |
1495 | -\fIunzipsfx\fP on the Amiga requires the use of a special program, MakeSFX, |
1496 | -in order to create working self-extracting archives; simple concatenation |
1497 | -does not work. (For technically oriented users, the attached archive is |
1498 | -defined as a ``debug hunk.'') There may be compatibility problems between |
1499 | -the ROM levels of older Amigas and newer ones. |
1500 | -.PP |
1501 | -All current bugs in \fIunzip\fP(1L) exist in \fIunzipsfx\fP as well. |
1502 | -.PD |
1503 | -.\" ========================================================================= |
1504 | -.SH DIAGNOSTICS |
1505 | -\fIunzipsfx\fP's exit status (error level) is identical to that of |
1506 | -\fIunzip\fP(1L); see the corresponding man page. |
1507 | -.PD |
1508 | -.\" ========================================================================= |
1509 | -.SH "SEE ALSO" |
1510 | -\fIfunzip\fP(1L), \fIunzip\fP(1L), \fIzip\fP(1L), \fIzipcloak\fP(1L), |
1511 | -\fIzipgrep\fP(1L), \fIzipinfo\fP(1L), \fIzipnote\fP(1L), \fIzipsplit\fP(1L) |
1512 | -.PD |
1513 | -.PD |
1514 | -.\" ========================================================================= |
1515 | -.SH URL |
1516 | -The Info-ZIP home page is currently at |
1517 | -.EX |
1518 | -\fChttp://www.info-zip.org/pub/infozip/\fR |
1519 | -.EE |
1520 | -or |
1521 | -.EX |
1522 | -\fCftp://ftp.info-zip.org/pub/infozip/\fR . |
1523 | -.EE |
1524 | -.PD |
1525 | -.\" ========================================================================= |
1526 | -.SH AUTHORS |
1527 | -Greg Roelofs was responsible for the basic modifications to UnZip necessary |
1528 | -to create UnZipSFX. See \fIunzip\fP(1L) for the current list of Zip-Bugs |
1529 | -authors, or the file CONTRIBS in the UnZip source distribution for the |
1530 | -full list of Info-ZIP contributors. |
1531 | -.PD |
1532 | |
1533 | === removed file '.pc/01-manpages-in-section-1-not-in-section-1l/man/zipgrep.1' |
1534 | --- .pc/01-manpages-in-section-1-not-in-section-1l/man/zipgrep.1 2010-02-21 17:01:00 +0000 |
1535 | +++ .pc/01-manpages-in-section-1-not-in-section-1l/man/zipgrep.1 1970-01-01 00:00:00 +0000 |
1536 | @@ -1,89 +0,0 @@ |
1537 | -.\" Copyright (c) 1990-2009 Info-ZIP. All rights reserved. |
1538 | -.\" |
1539 | -.\" See the accompanying file LICENSE, version 2009-Jan-02 or later |
1540 | -.\" (the contents of which are also included in unzip.h) for terms of use. |
1541 | -.\" If, for some reason, all these files are missing, the Info-ZIP license |
1542 | -.\" also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html |
1543 | -.\" |
1544 | -.\" zipgrep.1 by Greg Roelofs. |
1545 | -.\" |
1546 | -.\" ========================================================================= |
1547 | -.TH ZIPGREP 1L "20 April 2009" "Info-ZIP" |
1548 | -.SH NAME |
1549 | -zipgrep \- search files in a ZIP archive for lines matching a pattern |
1550 | -.PD |
1551 | -.SH SYNOPSIS |
1552 | -\fBzipgrep\fP [\fBegrep_options\fP] \fIpattern\fP |
1553 | -\fIfile\fP[\fI.zip\fP] [\fIfile(s)\fP\ .\|.\|.] |
1554 | -[\fB\-x\fP\ \fIxfile(s)\fP\ .\|.\|.] |
1555 | -.PD |
1556 | -.\" ========================================================================= |
1557 | -.SH DESCRIPTION |
1558 | -\fIzipgrep\fP will search files within a ZIP archive for lines matching |
1559 | -the given string or pattern. \fIzipgrep\fP is a shell script and requires |
1560 | -\fIegrep\fP(1) and \fIunzip\fP(1L) to function. Its output is identical to |
1561 | -that of \fIegrep\fP(1). |
1562 | -.PD |
1563 | -.\" ========================================================================= |
1564 | -.SH ARGUMENTS |
1565 | -.TP |
1566 | -.IP \fIpattern\fP |
1567 | -The pattern to be located within a ZIP archive. Any string or regular |
1568 | -expression accepted by \fIegrep\fP(1) may be used. |
1569 | -.IR file [ .zip ] |
1570 | -Path of the ZIP archive. (Wildcard expressions for the ZIP archive name are |
1571 | -not supported.) If the literal filename is not found, the suffix \fC.zip\fR |
1572 | -is appended. Note that self-extracting ZIP files are supported, as with any |
1573 | -other ZIP archive; just specify the \fC.exe\fR suffix (if any) explicitly. |
1574 | -.IP [\fIfile(s)\fP] |
1575 | -An optional list of archive members to be processed, separated by spaces. |
1576 | -If no member files are specified, all members of the ZIP archive are searched. |
1577 | -Regular expressions (wildcards) may be used to match multiple members: |
1578 | -.RS |
1579 | -.IP * |
1580 | -matches a sequence of 0 or more characters |
1581 | -.IP ? |
1582 | -matches exactly 1 character |
1583 | -.IP [.\|.\|.] |
1584 | -matches any single character found inside the brackets; ranges are specified |
1585 | -by a beginning character, a hyphen, and an ending character. If an exclamation |
1586 | -point or a caret (`!' or `^') follows the left bracket, then the range of |
1587 | -characters within the brackets is complemented (that is, anything \fIexcept\fP |
1588 | -the characters inside the brackets is considered a match). |
1589 | -.RE |
1590 | -.IP |
1591 | -(Be sure to quote any character that might otherwise be interpreted or |
1592 | -modified by the operating system.) |
1593 | -.IP [\fB\-x\fP\ \fIxfile(s)\fP] |
1594 | -An optional list of archive members to be excluded from processing. |
1595 | -Since wildcard characters match directory separators (`/'), this option |
1596 | -may be used to exclude any files that are in subdirectories. For |
1597 | -example, ``\fCzipgrep grumpy foo *.[ch] -x */*\fR'' would search for the |
1598 | -string ``grumpy'' in all C source files in the main directory of the ``foo'' |
1599 | -archive, but none in any subdirectories. Without the \fB\-x\fP |
1600 | -option, all C source files in all directories within the zipfile would be |
1601 | -searched. |
1602 | -.\" ========================================================================= |
1603 | -.SH OPTIONS |
1604 | -All options prior to the ZIP archive filename are passed to \fIegrep\fP(1). |
1605 | -.PD |
1606 | -.\" ========================================================================= |
1607 | -.SH "SEE ALSO" |
1608 | -\fIegrep\fP(1), \fIunzip\fP(1L), \fIzip\fP(1L), \fIfunzip\fP(1L), |
1609 | -\fIzipcloak\fP(1L), \fIzipinfo\fP(1L), \fIzipnote\fP(1L), \fIzipsplit\fP(1L) |
1610 | -.PD |
1611 | -.\" ========================================================================= |
1612 | -.SH URL |
1613 | -The Info-ZIP home page is currently at |
1614 | -.EX |
1615 | -\fChttp://www.info-zip.org/pub/infozip/\fR |
1616 | -.EE |
1617 | -or |
1618 | -.EX |
1619 | -\fCftp://ftp.info-zip.org/pub/infozip/\fR . |
1620 | -.EE |
1621 | -.PD |
1622 | -.\" ========================================================================= |
1623 | -.SH AUTHORS |
1624 | -\fIzipgrep\fP was written by Jean-loup Gailly. |
1625 | -.PD |
1626 | |
1627 | === removed file '.pc/01-manpages-in-section-1-not-in-section-1l/man/zipinfo.1' |
1628 | --- .pc/01-manpages-in-section-1-not-in-section-1l/man/zipinfo.1 2010-02-21 17:01:00 +0000 |
1629 | +++ .pc/01-manpages-in-section-1-not-in-section-1l/man/zipinfo.1 1970-01-01 00:00:00 +0000 |
1630 | @@ -1,517 +0,0 @@ |
1631 | -.\" Copyright (c) 1990-2009 Info-ZIP. All rights reserved. |
1632 | -.\" |
1633 | -.\" See the accompanying file LICENSE, version 2009-Jan-02 or later |
1634 | -.\" (the contents of which are also included in unzip.h) for terms of use. |
1635 | -.\" If, for some reason, all these files are missing, the Info-ZIP license |
1636 | -.\" also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html |
1637 | -.\" |
1638 | -.\" zipinfo.1 by Greg Roelofs and others. |
1639 | -.\" |
1640 | -.\" ========================================================================= |
1641 | -.\" define .X macro (for long-line ZipInfo output examples; small Courier): |
1642 | -.de X |
1643 | -.nf |
1644 | -.ft CW |
1645 | -.ie n .ti -5 |
1646 | -.el \{ .ti +2m |
1647 | -.ps -1 \} |
1648 | -\&\\$1 |
1649 | -.ie n .ti +5 |
1650 | -.el \{ .ti -2m |
1651 | -.ps +1 \} |
1652 | -.ft |
1653 | -.fi |
1654 | -.. |
1655 | -.\" define .EX/.EE (for multiline user-command examples; normal Courier font) |
1656 | -.de EX |
1657 | -.in +4n |
1658 | -.nf |
1659 | -.ft CW |
1660 | -.. |
1661 | -.de EE |
1662 | -.ft |
1663 | -.fi |
1664 | -.in -4n |
1665 | -.. |
1666 | -.\" ========================================================================= |
1667 | -.TH ZIPINFO 1L "20 April 2009 (v3.0)" "Info-ZIP" |
1668 | -.SH NAME |
1669 | -zipinfo \- list detailed information about a ZIP archive |
1670 | -.PD |
1671 | -.SH SYNOPSIS |
1672 | -\fBzipinfo\fP [\fB\-12smlvhMtTz\fP] \fIfile\fP[\fI.zip\fP] |
1673 | -[\fIfile(s)\fP\ .\|.\|.] [\fB\-x\fP\ \fIxfile(s)\fP\ .\|.\|.] |
1674 | -.PP |
1675 | -\fBunzip\fP \fB\-Z\fP [\fB\-12smlvhMtTz\fP] \fIfile\fP[\fI.zip\fP] |
1676 | -[\fIfile(s)\fP\ .\|.\|.] [\fB\-x\fP\ \fIxfile(s)\fP\ .\|.\|.] |
1677 | -.PD |
1678 | -.\" ========================================================================= |
1679 | -.SH DESCRIPTION |
1680 | -\fIzipinfo\fP lists technical information about files in a ZIP archive, most |
1681 | -commonly found on MS-DOS systems. Such information includes file access |
1682 | -permissions, encryption status, type of compression, version and operating |
1683 | -system or file system of compressing program, and the like. The default |
1684 | -behavior (with no options) is |
1685 | -to list single-line entries for each file in the archive, with header and |
1686 | -trailer lines providing summary information for the entire archive. The |
1687 | -format is a cross between Unix ``\fCls \-l\fR'' and ``\fCunzip \-v\fR'' |
1688 | -output. See |
1689 | -.B "DETAILED DESCRIPTION" |
1690 | -below. Note that \fIzipinfo\fP is the same program as \fIunzip\fP (under |
1691 | -Unix, a link to it); on some systems, however, \fIzipinfo\fP support may |
1692 | -have been omitted when \fIunzip\fP was compiled. |
1693 | -.PD |
1694 | -.\" ========================================================================= |
1695 | -.SH ARGUMENTS |
1696 | -.TP |
1697 | -.IR file [ .zip ] |
1698 | -Path of the ZIP archive(s). If the file specification is a wildcard, |
1699 | -each matching file is processed in an order determined by the operating |
1700 | -system (or file system). Only the filename can be a wildcard; the path |
1701 | -itself cannot. Wildcard expressions are similar to Unix \fIegrep\fP(1) |
1702 | -(regular) expressions and may contain: |
1703 | -.RS |
1704 | -.IP * |
1705 | -matches a sequence of 0 or more characters |
1706 | -.IP ? |
1707 | -matches exactly 1 character |
1708 | -.IP [.\|.\|.] |
1709 | -matches any single character found inside the brackets; ranges are specified |
1710 | -by a beginning character, a hyphen, and an ending character. If an exclamation |
1711 | -point or a caret (`!' or `^') follows the left bracket, then the range of |
1712 | -characters within the brackets is complemented (that is, anything \fIexcept\fP |
1713 | -the characters inside the brackets is considered a match). To specify a |
1714 | -verbatim left bracket, the three-character sequence ``[[]'' has to be used. |
1715 | -.RE |
1716 | -.IP |
1717 | -(Be sure to quote any character that might otherwise be interpreted or |
1718 | -modified by the operating system, particularly under Unix and VMS.) If no |
1719 | -matches are found, the specification is assumed to be a literal filename; |
1720 | -and if that also fails, the suffix \fC.zip\fR is appended. Note that |
1721 | -self-extracting ZIP files are supported, as with any other ZIP archive; |
1722 | -just specify the \fC.exe\fR suffix (if any) explicitly. |
1723 | -.IP [\fIfile(s)\fP] |
1724 | -An optional list of archive members to be processed, separated by spaces. |
1725 | -(VMS versions compiled with VMSCLI defined must delimit files with commas |
1726 | -instead.) |
1727 | -Regular expressions (wildcards) may be used to match multiple members; see |
1728 | -above. Again, be sure to quote expressions that would otherwise be expanded |
1729 | -or modified by the operating system. |
1730 | -.IP [\fB\-x\fP\ \fIxfile(s)\fP] |
1731 | -An optional list of archive members to be excluded from processing. |
1732 | -.\" ========================================================================= |
1733 | -.SH OPTIONS |
1734 | -.TP |
1735 | -.B \-1 |
1736 | -list filenames only, one per line. This option excludes all others; headers, |
1737 | -trailers and zipfile comments are never printed. It is intended for use in |
1738 | -Unix shell scripts. |
1739 | -.TP |
1740 | -.B \-2 |
1741 | -list filenames only, one per line, but allow headers (\fB\-h\fP), trailers |
1742 | -(\fB\-t\fP) and zipfile comments (\fB\-z\fP), as well. This option may be |
1743 | -useful in cases where the stored filenames are particularly long. |
1744 | -.TP |
1745 | -.B \-s |
1746 | -list zipfile info in short Unix ``\fCls \-l\fR'' format. This is the default |
1747 | -behavior; see below. |
1748 | -.TP |
1749 | -.B \-m |
1750 | -list zipfile info in medium Unix ``\fCls \-l\fR'' format. Identical to the |
1751 | -\fB\-s\fP output, except that the compression factor, expressed as a |
1752 | -percentage, is also listed. |
1753 | -.TP |
1754 | -.B \-l |
1755 | -list zipfile info in long Unix ``\fCls \-l\fR'' format. As with \fB\-m\fP |
1756 | -except that the compressed size (in bytes) is printed instead of the |
1757 | -compression ratio. |
1758 | -.TP |
1759 | -.B \-v |
1760 | -list zipfile information in verbose, multi-page format. |
1761 | -.TP |
1762 | -.B \-h |
1763 | -list header line. The archive name, actual size (in bytes) and total number |
1764 | -of files is printed. |
1765 | -.TP |
1766 | -.B \-M |
1767 | -pipe all output through an internal pager similar to the Unix \fImore\fP(1) |
1768 | -command. At the end of a screenful of output, \fIzipinfo\fP pauses with a |
1769 | -``\-\-More\-\-'' prompt; the next screenful may be viewed by pressing the |
1770 | -Enter (Return) key or the space bar. \fIzipinfo\fP can be terminated by |
1771 | -pressing the ``q'' key and, on some systems, the Enter/Return key. Unlike |
1772 | -Unix \fImore\fP(1), there is no forward-searching or editing capability. |
1773 | -Also, \fIzipinfo\fP doesn't notice if long lines wrap at the edge of the |
1774 | -screen, effectively resulting in the printing of two or more lines and the |
1775 | -likelihood that some text will scroll off the top of the screen before being |
1776 | -viewed. On some systems the number of available lines on the screen is not |
1777 | -detected, in which case \fIzipinfo\fP assumes the height is 24 lines. |
1778 | -.TP |
1779 | -.B \-t |
1780 | -list totals for files listed or for all files. The number of files listed, |
1781 | -their uncompressed and compressed total sizes , and their overall compression |
1782 | -factor is printed; or, if only the totals line is being printed, the values |
1783 | -for the entire archive are given. The compressed total size does not include |
1784 | -the 12 additional header bytes of each encrypted entry. Note that the total |
1785 | -compressed (data) size will never match the actual zipfile size, since the |
1786 | -latter includes all of the internal zipfile headers in addition to the |
1787 | -compressed data. |
1788 | -.TP |
1789 | -.B \-T |
1790 | -print the file dates and times in a sortable decimal format (yymmdd.hhmmss). |
1791 | -The default date format is a more standard, human-readable version with |
1792 | -abbreviated month names (see examples below). |
1793 | -.TP |
1794 | -.B \-U |
1795 | -[UNICODE_SUPPORT only] modify or disable UTF-8 handling. |
1796 | -When UNICODE_SUPPORT is available, the option \fB\-U\fP forces \fIunzip\fP |
1797 | -to escape all non-ASCII characters from UTF-8 coded filenames as ``#Uxxxx''. |
1798 | -This option is mainly provided for debugging purpose when the fairly new |
1799 | -UTF-8 support is suspected to mangle up extracted filenames. |
1800 | -.IP |
1801 | -The option \fB\-UU\fP allows to entirely disable the recognition of UTF-8 |
1802 | -encoded filenames. The handling of filename codings within \fIunzip\fP falls |
1803 | -back to the behaviour of previous versions. |
1804 | -.TP |
1805 | -.B \-z |
1806 | -include the archive comment (if any) in the listing. |
1807 | -.PD |
1808 | -.\" ========================================================================= |
1809 | -.SH "DETAILED DESCRIPTION" |
1810 | -.I zipinfo |
1811 | -has a number of modes, and its behavior can be rather difficult to fathom |
1812 | -if one isn't familiar with Unix \fIls\fP(1) (or even if one is). The default |
1813 | -behavior is to list files in the following format: |
1814 | -.PP |
1815 | -.X "-rw-rws--- 1.9 unx 2802 t- defX 11-Aug-91 13:48 perms.2660" |
1816 | -.PP |
1817 | -The last three fields are the modification date and time of |
1818 | -the file, and its name. The case of the filename is respected; thus |
1819 | -files that come from MS-DOS PKZIP are always capitalized. If the file |
1820 | -was zipped with a stored directory name, that is also displayed as part |
1821 | -of the filename. |
1822 | -.PP |
1823 | -The second and third fields indicate that the file was zipped under |
1824 | -Unix with version 1.9 of \fIzip\fP. Since it comes from Unix, the file |
1825 | -permissions at the beginning of the line are printed in Unix format. |
1826 | -The uncompressed file-size (2802 in this example) is the fourth field. |
1827 | -.PP |
1828 | -The fifth field consists of two characters, either of which may take |
1829 | -on several values. The first character may be either `t' or `b', indicating |
1830 | -that \fIzip\fP believes the file to be text or binary, respectively; |
1831 | -but if the file is encrypted, \fIzipinfo\fP |
1832 | -notes this fact by capitalizing the character (`T' or `B'). The second |
1833 | -character may also take on four values, depending on whether there is |
1834 | -an extended local header and/or an ``extra field'' associated with the |
1835 | -file (fully explained in PKWare's APPNOTE.TXT, but basically analogous to |
1836 | -pragmas in ANSI C--i.e., they provide a standard way to include non-standard |
1837 | -information in the archive). If neither exists, the character |
1838 | -will be a hyphen (`\-'); if there is an extended local header but no extra |
1839 | -field, `l'; if the reverse, `x'; and if both exist, `X'. Thus the |
1840 | -file in this example is (probably) a text file, is not encrypted, and |
1841 | -has neither an extra field nor an extended local header associated with it. |
1842 | -The example below, on the other hand, is an encrypted binary file with an |
1843 | -extra field: |
1844 | -.PP |
1845 | -.X "RWD,R,R 0.9 vms 168 Bx shrk 9-Aug-91 19:15 perms.0644" |
1846 | -.PP |
1847 | -Extra fields are used for various purposes (see discussion of the \fB\-v\fP |
1848 | -option below) including the storage of VMS file attributes, which is |
1849 | -presumably the case here. Note that the file attributes are listed in |
1850 | -VMS format. Some other possibilities for the host operating system (which |
1851 | -is actually a misnomer--host file system is more correct) include |
1852 | -OS/2 or NT with High Performance File System (HPFS), MS-DOS, OS/2 or NT |
1853 | -with File Allocation Table (FAT) file system, and Macintosh. These are |
1854 | -denoted as follows: |
1855 | -.PP |
1856 | -.X "-rw-a-- 1.0 hpf 5358 Tl i4:3 4-Dec-91 11:33 longfilename.hpfs" |
1857 | -.X "-r--ahs 1.1 fat 4096 b- i4:2 14-Jul-91 12:58 EA DATA. SF" |
1858 | -.X "--w------- 1.0 mac 17357 bx i8:2 4-May-92 04:02 unzip.macr" |
1859 | -.PP |
1860 | -File attributes in the first two cases are indicated in a Unix-like format, |
1861 | -where the seven subfields indicate whether the file: (1) is a directory, |
1862 | -(2) is readable (always true), (3) is writable, (4) is executable (guessed |
1863 | -on the basis of the extension--\fI.exe\fP, \fI.com\fP, \fI.bat\fP, \fI.cmd\fP |
1864 | -and \fI.btm\fP files are assumed to be so), (5) has its archive bit set, |
1865 | -(6) is hidden, and (7) is a system file. Interpretation of Macintosh file |
1866 | -attributes is unreliable because some Macintosh archivers don't store any |
1867 | -attributes in the archive. |
1868 | -.PP |
1869 | -Finally, the sixth field indicates |
1870 | -the compression method and possible sub-method used. There are six methods |
1871 | -known at present: storing (no compression), reducing, shrinking, imploding, |
1872 | -tokenizing (never publicly released), and deflating. In addition, there are |
1873 | -four levels of reducing (1 through 4); four types of imploding (4K or 8K |
1874 | -sliding dictionary, and 2 or 3 Shannon-Fano trees); and four levels of |
1875 | -deflating (superfast, fast, normal, maximum compression). \fIzipinfo\fP |
1876 | -represents these methods and their sub-methods as follows: \fIstor\fP; |
1877 | -\fIre:1\fP, \fIre:2\fP, etc.; \fIshrk\fP; \fIi4:2\fP, \fIi8:3\fP, etc.; |
1878 | -\fItokn\fP; and \fIdefS\fP, \fIdefF\fP, \fIdefN\fP, and \fIdefX\fP. |
1879 | -.PP |
1880 | -The medium and long listings are almost identical to the short format except |
1881 | -that they add information on the file's compression. The medium format lists |
1882 | -the file's compression factor as a percentage indicating the amount of space |
1883 | -that has been ``removed'': |
1884 | -.PP |
1885 | -.X "-rw-rws--- 1.5 unx 2802 t- 81% defX 11-Aug-91 13:48 perms.2660" |
1886 | -.PP |
1887 | -In this example, the file has been compressed by more than a factor of |
1888 | -five; the compressed data are only 19% of the original size. The long |
1889 | -format gives the compressed file's size in bytes, instead: |
1890 | -.PP |
1891 | -.X "-rw-rws--- 1.5 unx 2802 t- 538 defX 11-Aug-91 13:48 perms.2660" |
1892 | -.PP |
1893 | -In contrast to the \fIunzip\fP listings, the compressed size figures in |
1894 | -this listing format denote the complete size of compressed data, including |
1895 | -the 12 extra header bytes in case of encrypted entries. |
1896 | -.PP |
1897 | -Adding the \fB\-T\fP option changes the file date and time to decimal |
1898 | -format: |
1899 | -.PP |
1900 | -.X "-rw-rws--- 1.5 unx 2802 t- 538 defX 910811.134804 perms.2660" |
1901 | -.PP |
1902 | -Note that because of limitations in the MS-DOS format used to store file |
1903 | -times, the seconds field is always rounded to the nearest even second. |
1904 | -For Unix files this is expected to change in the next major releases of |
1905 | -\fIzip\fP(1L) and \fIunzip\fP. |
1906 | -.PP |
1907 | -In addition to individual file information, a default zipfile listing |
1908 | -also includes header and trailer lines: |
1909 | -.PP |
1910 | -.X "Archive: OS2.zip 5453 bytes 5 files" |
1911 | -.X ",,rw, 1.0 hpf 730 b- i4:3 26-Jun-92 23:40 Contents" |
1912 | -.X ",,rw, 1.0 hpf 3710 b- i4:3 26-Jun-92 23:33 makefile.os2" |
1913 | -.X ",,rw, 1.0 hpf 8753 b- i8:3 26-Jun-92 15:29 os2unzip.c" |
1914 | -.X ",,rw, 1.0 hpf 98 b- stor 21-Aug-91 15:34 unzip.def" |
1915 | -.X ",,rw, 1.0 hpf 95 b- stor 21-Aug-91 17:51 zipinfo.def" |
1916 | -.X "5 files, 13386 bytes uncompressed, 4951 bytes compressed: 63.0%" |
1917 | -.PP |
1918 | -The header line gives the name of the archive, its total size, and the |
1919 | -total number of files; the trailer gives the number of files listed, |
1920 | -their total uncompressed size, and their total compressed size (not |
1921 | -including any of \fIzip\fP's internal overhead). If, however, one or |
1922 | -more \fIfile(s)\fP are provided, the header and trailer lines are |
1923 | -not listed. This behavior is also similar to that of Unix's ``\fCls \-l\fR''; |
1924 | -it may be overridden by specifying the \fB\-h\fP and \fB\-t\fP options |
1925 | -explicitly. |
1926 | -In such a case the listing format must also be specified explicitly, |
1927 | -since \fB\-h\fP or \fB\-t\fP (or both) in the absence of other options implies |
1928 | -that ONLY the header or trailer line (or both) is listed. See the |
1929 | -\fBEXAMPLES\fP section below for a semi-intelligible translation of this |
1930 | -nonsense. |
1931 | -.PP |
1932 | -The verbose listing is mostly self-explanatory. It also lists file |
1933 | -comments and the zipfile comment, if any, and the type and number of bytes |
1934 | -in any stored extra fields. Currently known types of extra fields include |
1935 | -PKWARE's authentication (``AV'') info; OS/2 extended attributes; VMS |
1936 | -filesystem info, both PKWARE and Info-ZIP versions; Macintosh resource |
1937 | -forks; Acorn/Archimedes SparkFS info; and so on. (Note |
1938 | -that in the case of OS/2 extended attributes--perhaps the most common |
1939 | -use of zipfile extra fields--the size of the stored EAs as reported by |
1940 | -\fIzipinfo\fP may not match the number given by OS/2's \fIdir\fP command: |
1941 | -OS/2 always reports the number of bytes required in 16-bit format, whereas |
1942 | -\fIzipinfo\fP always reports the 32-bit storage.) |
1943 | -.PP |
1944 | -Again, the compressed size figures of the individual entries include the |
1945 | -12 extra header bytes for encrypted entries. In contrast, the archive total |
1946 | -compressed size and the average compression ratio shown in the summary |
1947 | -bottom line are calculated \fBwithout\fP the extra 12 header bytes of |
1948 | -encrypted entries. |
1949 | -.PD |
1950 | -.\" ========================================================================= |
1951 | -.SH "ENVIRONMENT OPTIONS" |
1952 | -Modifying \fIzipinfo\fP's default behavior via options placed in |
1953 | -an environment variable can be a bit complicated to explain, due to |
1954 | -\fIzipinfo\fP's attempts to handle various defaults in an intuitive, |
1955 | -yet Unix-like, manner. (Try not to laugh.) Nevertheless, there is some |
1956 | -underlying logic. In brief, |
1957 | -there are three ``priority levels'' of options: the default options; |
1958 | -environment options, which can override or add to the defaults; and |
1959 | -explicit options given by the user, which can override or add to |
1960 | -either of the above. |
1961 | -.PP |
1962 | -The default listing format, as noted above, corresponds roughly |
1963 | -to the "\fCzipinfo \-hst\fR" command (except when individual zipfile members |
1964 | -are specified). |
1965 | -A user who prefers the long-listing format (\fB\-l\fP) can make use of the |
1966 | -\fIzipinfo\fP's environment variable to change this default: |
1967 | -.TP |
1968 | -Unix Bourne shell: |
1969 | -\f(CW\&ZIPINFO=\-l; export ZIPINFO\fP |
1970 | -.TP |
1971 | -Unix C shell: |
1972 | -\f(CW\&setenv ZIPINFO \-l\fP |
1973 | -.TP |
1974 | -OS/2 or MS-DOS: |
1975 | -\f(CW\&set ZIPINFO=\-l\fP |
1976 | -.TP |
1977 | -VMS (quotes for \fIlowercase\fP): |
1978 | -\f(CW\&define ZIPINFO_OPTS "\-l"\fP |
1979 | -.EE |
1980 | -.PP |
1981 | -If, in addition, the user dislikes the trailer line, \fIzipinfo\fP's |
1982 | -concept of ``negative options'' may be used to override the default |
1983 | -inclusion of the line. This is accomplished by preceding the undesired |
1984 | -option with one or more minuses: e.g., ``\fC\-l\-t\fR'' or ``\fC\-\-tl\fR'', |
1985 | -in this example. The first hyphen is the regular switch character, but the |
1986 | -one before the `t' is a minus sign. The dual use of hyphens may seem a |
1987 | -little awkward, but it's reasonably intuitive nonetheless: simply ignore |
1988 | -the first hyphen and go from there. It is also consistent with the behavior |
1989 | -of the Unix command \fInice\fP(1). |
1990 | -.PP |
1991 | -As suggested above, the default variable names are ZIPINFO_OPTS for VMS |
1992 | -(where the symbol used to install \fIzipinfo\fP as a foreign command |
1993 | -would otherwise be confused with the environment variable), and ZIPINFO |
1994 | -for all other operating systems. For compatibility with \fIzip\fP(1L), |
1995 | -ZIPINFOOPT is also accepted (don't ask). If both ZIPINFO and ZIPINFOOPT |
1996 | -are defined, however, ZIPINFO takes precedence. \fIunzip\fP's diagnostic |
1997 | -option (\fB\-v\fP with no zipfile name) can be used to check the values |
1998 | -of all four possible \fIunzip\fP and \fIzipinfo\fP environment variables. |
1999 | -.PD |
2000 | -.\" ========================================================================= |
2001 | -.SH EXAMPLES |
2002 | -To get a basic, short-format listing of the complete contents of a ZIP |
2003 | -archive \fIstorage.zip\fP, with both header and totals lines, use only |
2004 | -the archive name as an argument to zipinfo: |
2005 | -.PP |
2006 | -.EX |
2007 | -zipinfo storage |
2008 | -.EE |
2009 | -.PP |
2010 | -To produce a basic, long-format listing (not verbose), including header and |
2011 | -totals lines, use \fB\-l\fP: |
2012 | -.PP |
2013 | -.EX |
2014 | -zipinfo \-l storage |
2015 | -.EE |
2016 | -.PP |
2017 | -To list the complete contents of the archive without header and totals |
2018 | -lines, either negate the \fB\-h\fP and \fB\-t\fP options or else specify the |
2019 | -contents explicitly: |
2020 | -.PP |
2021 | -.EX |
2022 | -zipinfo \-\-h\-t storage |
2023 | -zipinfo storage \e* |
2024 | -.EE |
2025 | -.PP |
2026 | -(where the backslash is required only if the shell would otherwise expand |
2027 | -the `*' wildcard, as in Unix when globbing is turned on--double quotes around |
2028 | -the asterisk would have worked as well). To turn off the totals line by |
2029 | -default, use the environment variable (C shell is assumed here): |
2030 | -.PP |
2031 | -.EX |
2032 | -setenv ZIPINFO \-\-t |
2033 | -zipinfo storage |
2034 | -.EE |
2035 | -.PP |
2036 | -To get the full, short-format listing of the first example again, given |
2037 | -that the environment variable is set as in the previous example, it is |
2038 | -necessary to specify the \fB\-s\fP option explicitly, since the \fB\-t\fP |
2039 | -option by itself implies that ONLY the footer line is to be printed: |
2040 | -.PP |
2041 | -.EX |
2042 | -setenv ZIPINFO \-\-t |
2043 | -zipinfo \-t storage \fR[only totals line]\fP |
2044 | -zipinfo \-st storage \fR[full listing]\fP |
2045 | -.EE |
2046 | -.PP |
2047 | -The \fB\-s\fP option, like \fB\-m\fP and \fB\-l\fP, includes headers and |
2048 | -footers by default, unless otherwise specified. Since the environment |
2049 | -variable specified no footers and that has a higher precedence than the |
2050 | -default behavior of \fB\-s\fP, an explicit \fB\-t\fP option was necessary |
2051 | -to produce the full listing. Nothing was indicated about the header, |
2052 | -however, so the \fB\-s\fP option was sufficient. Note that both the |
2053 | -\fB\-h\fP and \fB\-t\fP options, when used by themselves or with |
2054 | -each other, override any default listing of member files; only the header |
2055 | -and/or footer are printed. This behavior is useful when \fIzipinfo\fP is |
2056 | -used with a wildcard zipfile specification; the contents of all zipfiles |
2057 | -are then summarized with a single command. |
2058 | -.PP |
2059 | -To list information on a single file within the archive, in medium format, |
2060 | -specify the filename explicitly: |
2061 | -.PP |
2062 | -.EX |
2063 | -zipinfo \-m storage unshrink.c |
2064 | -.EE |
2065 | -.PP |
2066 | -The specification of any member file, as in this example, will override |
2067 | -the default header and totals lines; only the single line of information |
2068 | -about the requested file will be printed. This is intuitively what one |
2069 | -would expect when requesting information about a single file. For multiple |
2070 | -files, it is often useful to know the total compressed and uncompressed |
2071 | -size; in such cases \fB\-t\fP may be specified explicitly: |
2072 | -.PP |
2073 | -.EX |
2074 | -zipinfo \-mt storage "*.[ch]" Mak\e* |
2075 | -.EE |
2076 | -.PP |
2077 | -To get maximal information about the ZIP archive, use the verbose |
2078 | -option. It is usually wise to pipe the output into a filter such as |
2079 | -Unix \fImore\fP(1) if the operating system allows it: |
2080 | -.PP |
2081 | -.EX |
2082 | -zipinfo \-v storage | more |
2083 | -.EE |
2084 | -.PP |
2085 | -Finally, to see the most recently modified files in the archive, use |
2086 | -the \fB\-T\fP option in conjunction with an external sorting utility |
2087 | -such as Unix \fIsort\fP(1) (and \fIsed\fP(1) as well, in this example): |
2088 | -.PP |
2089 | -.EX |
2090 | -zipinfo \-T storage | sort -nr -k 7 | sed 15q |
2091 | -.EE |
2092 | -.PP |
2093 | -The \fB\-nr\fP option to \fIsort\fP(1) tells it to sort numerically |
2094 | -in reverse order rather than in textual order, and the \fB\-k\ 7\fP option |
2095 | -tells it to sort on the seventh field. This |
2096 | -assumes the default short-listing format; if \fB\-m\fP or \fB\-l\fP is |
2097 | -used, the proper \fIsort\fP(1) option would be \fB\-k\ 8\fP. |
2098 | -Older versions of \fIsort\fP(1) do not support the \fB\-k\fP option, |
2099 | -but you can use the traditional \fB\+\fP option instead, e.g., |
2100 | -\fB\+6\fP instead of \fB\-k\ 7\fP. The \fIsed\fP(1) |
2101 | -command filters out all but the first 15 lines of the listing. Future |
2102 | -releases of \fIzipinfo\fP may incorporate date/time and filename sorting |
2103 | -as built-in options. |
2104 | -.PD |
2105 | -.\" ========================================================================= |
2106 | -.SH TIPS |
2107 | -The author finds it convenient to define an alias \fIii\fP for \fIzipinfo\fP |
2108 | -on systems that allow aliases (or, on other systems, copy/rename the |
2109 | -executable, create a link or create a command file with the name \fIii\fP). |
2110 | -The \fIii\fP usage parallels the common \fIll\fP alias for long listings in |
2111 | -Unix, and the similarity between the outputs of the two commands was |
2112 | -intentional. |
2113 | -.PD |
2114 | -.\" ========================================================================= |
2115 | -.SH BUGS |
2116 | -As with \fIunzip\fP, \fIzipinfo\fP's \fB\-M\fP (``more'') option is overly |
2117 | -simplistic in its handling of screen output; as noted above, it fails to detect |
2118 | -the wrapping of long lines and may thereby cause lines at the top of the screen |
2119 | -to be scrolled off before being read. \fIzipinfo\fP should detect and treat |
2120 | -each occurrence of line-wrap as one additional line printed. This requires |
2121 | -knowledge of the screen's width as well as its height. In addition, |
2122 | -\fIzipinfo\fP should detect the true screen geometry on all systems. |
2123 | -.PP |
2124 | -\fIzipinfo\fP's listing-format behavior is unnecessarily complex and should |
2125 | -be simplified. (This is not to say that it will be.) |
2126 | -.PP |
2127 | -.\" ========================================================================= |
2128 | -.SH "SEE ALSO" |
2129 | -\fIls\fP(1), \fIfunzip\fP(1L), \fIunzip\fP(1L), \fIunzipsfx\fP(1L), |
2130 | -\fIzip\fP(1L), \fIzipcloak\fP(1L), \fIzipnote\fP(1L), \fIzipsplit\fP(1L) |
2131 | -.PD |
2132 | -.\" ========================================================================= |
2133 | -.SH URL |
2134 | -The Info-ZIP home page is currently at |
2135 | -.EX |
2136 | -\fChttp://www.info-zip.org/pub/infozip/\fR |
2137 | -.EE |
2138 | -or |
2139 | -.EX |
2140 | -\fCftp://ftp.info-zip.org/pub/infozip/\fR . |
2141 | -.EE |
2142 | -.PD |
2143 | -.\" ========================================================================= |
2144 | -.SH AUTHOR |
2145 | -Greg ``Cave Newt'' Roelofs. ZipInfo contains pattern-matching code |
2146 | -by Mark Adler and fixes/improvements by many others. Please refer to the |
2147 | -CONTRIBS file in the UnZip source distribution for a more complete list. |
2148 | |
2149 | === removed directory '.pc/02-branding-patch-this-is-debian-unzip' |
2150 | === removed file '.pc/02-branding-patch-this-is-debian-unzip/unzip.c' |
2151 | --- .pc/02-branding-patch-this-is-debian-unzip/unzip.c 2010-02-21 17:01:00 +0000 |
2152 | +++ .pc/02-branding-patch-this-is-debian-unzip/unzip.c 1970-01-01 00:00:00 +0000 |
2153 | @@ -1,2655 +0,0 @@ |
2154 | -/* |
2155 | - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. |
2156 | - |
2157 | - See the accompanying file LICENSE, version 2009-Jan-02 or later |
2158 | - (the contents of which are also included in unzip.h) for terms of use. |
2159 | - If, for some reason, all these files are missing, the Info-ZIP license |
2160 | - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html |
2161 | -*/ |
2162 | -/*--------------------------------------------------------------------------- |
2163 | - |
2164 | - unzip.c |
2165 | - |
2166 | - UnZip - a zipfile extraction utility. See below for make instructions, or |
2167 | - read the comments in Makefile and the various Contents files for more de- |
2168 | - tailed explanations. To report a bug, submit a *complete* description via |
2169 | - //www.info-zip.org/zip-bug.html; include machine type, operating system and |
2170 | - version, compiler and version, and reasonably detailed error messages or |
2171 | - problem report. To join Info-ZIP, see the instructions in README. |
2172 | - |
2173 | - UnZip 5.x is a greatly expanded and partially rewritten successor to 4.x, |
2174 | - which in turn was almost a complete rewrite of version 3.x. For a detailed |
2175 | - revision history, see UnzpHist.zip at quest.jpl.nasa.gov. For a list of |
2176 | - the many (near infinite) contributors, see "CONTRIBS" in the UnZip source |
2177 | - distribution. |
2178 | - |
2179 | - UnZip 6.0 adds support for archives larger than 4 GiB using the Zip64 |
2180 | - extensions as well as support for Unicode information embedded per the |
2181 | - latest zip standard additions. |
2182 | - |
2183 | - --------------------------------------------------------------------------- |
2184 | - |
2185 | - [from original zipinfo.c] |
2186 | - |
2187 | - This program reads great gobs of totally nifty information, including the |
2188 | - central directory stuff, from ZIP archives ("zipfiles" for short). It |
2189 | - started as just a testbed for fooling with zipfiles, but at this point it |
2190 | - is actually a useful utility. It also became the basis for the rewrite of |
2191 | - UnZip (3.16 -> 4.0), using the central directory for processing rather than |
2192 | - the individual (local) file headers. |
2193 | - |
2194 | - As of ZipInfo v2.0 and UnZip v5.1, the two programs are combined into one. |
2195 | - If the executable is named "unzip" (or "unzip.exe", depending), it behaves |
2196 | - like UnZip by default; if it is named "zipinfo" or "ii", it behaves like |
2197 | - ZipInfo. The ZipInfo behavior may also be triggered by use of unzip's -Z |
2198 | - option; for example, "unzip -Z [zipinfo_options] archive.zip". |
2199 | - |
2200 | - Another dandy product from your buddies at Newtware! |
2201 | - |
2202 | - Author: Greg Roelofs, newt@pobox.com, http://pobox.com/~newt/ |
2203 | - 23 August 1990 -> April 1997 |
2204 | - |
2205 | - --------------------------------------------------------------------------- |
2206 | - |
2207 | - Version: unzip5??.{tar.Z | tar.gz | zip} for Unix, VMS, OS/2, MS-DOS, Amiga, |
2208 | - Atari, Windows 3.x/95/NT/CE, Macintosh, Human68K, Acorn RISC OS, |
2209 | - AtheOS, BeOS, SMS/QDOS, VM/CMS, MVS, AOS/VS, Tandem NSK, Theos |
2210 | - and TOPS-20. |
2211 | - |
2212 | - Copyrights: see accompanying file "LICENSE" in UnZip source distribution. |
2213 | - (This software is free but NOT IN THE PUBLIC DOMAIN.) |
2214 | - |
2215 | - ---------------------------------------------------------------------------*/ |
2216 | - |
2217 | - |
2218 | - |
2219 | -#define __UNZIP_C /* identifies this source module */ |
2220 | -#define UNZIP_INTERNAL |
2221 | -#include "unzip.h" /* includes, typedefs, macros, prototypes, etc. */ |
2222 | -#include "crypt.h" |
2223 | -#include "unzvers.h" |
2224 | - |
2225 | -#ifndef WINDLL /* The WINDLL port uses windll/windll.c instead... */ |
2226 | - |
2227 | -/***************************/ |
2228 | -/* Local type declarations */ |
2229 | -/***************************/ |
2230 | - |
2231 | -#if (defined(REENTRANT) && !defined(NO_EXCEPT_SIGNALS)) |
2232 | -typedef struct _sign_info |
2233 | - { |
2234 | - struct _sign_info *previous; |
2235 | - void (*sighandler)(int); |
2236 | - int sigtype; |
2237 | - } savsigs_info; |
2238 | -#endif |
2239 | - |
2240 | -/*******************/ |
2241 | -/* Local Functions */ |
2242 | -/*******************/ |
2243 | - |
2244 | -#if (defined(REENTRANT) && !defined(NO_EXCEPT_SIGNALS)) |
2245 | -static int setsignalhandler OF((__GPRO__ savsigs_info **p_savedhandler_chain, |
2246 | - int signal_type, void (*newhandler)(int))); |
2247 | -#endif |
2248 | -#ifndef SFX |
2249 | -static void help_extended OF((__GPRO)); |
2250 | -static void show_version_info OF((__GPRO)); |
2251 | -#endif |
2252 | - |
2253 | - |
2254 | -/*************/ |
2255 | -/* Constants */ |
2256 | -/*************/ |
2257 | - |
2258 | -#include "consts.h" /* all constant global variables are in here */ |
2259 | - /* (non-constant globals were moved to globals.c) */ |
2260 | - |
2261 | -/* constant local variables: */ |
2262 | - |
2263 | -#ifndef SFX |
2264 | -#ifndef _WIN32_WCE /* Win CE does not support environment variables */ |
2265 | - static ZCONST char Far EnvUnZip[] = ENV_UNZIP; |
2266 | - static ZCONST char Far EnvUnZip2[] = ENV_UNZIP2; |
2267 | - static ZCONST char Far EnvZipInfo[] = ENV_ZIPINFO; |
2268 | - static ZCONST char Far EnvZipInfo2[] = ENV_ZIPINFO2; |
2269 | -#ifdef RISCOS |
2270 | - static ZCONST char Far EnvUnZipExts[] = ENV_UNZIPEXTS; |
2271 | -#endif /* RISCOS */ |
2272 | - static ZCONST char Far NoMemEnvArguments[] = |
2273 | - "envargs: cannot get memory for arguments"; |
2274 | -#endif /* !_WIN32_WCE */ |
2275 | - static ZCONST char Far CmdLineParamTooLong[] = |
2276 | - "error: command line parameter #%d exceeds internal size limit\n"; |
2277 | -#endif /* !SFX */ |
2278 | - |
2279 | -#if (defined(REENTRANT) && !defined(NO_EXCEPT_SIGNALS)) |
2280 | - static ZCONST char Far CantSaveSigHandler[] = |
2281 | - "error: cannot save signal handler settings\n"; |
2282 | -#endif |
2283 | - |
2284 | -#if (!defined(SFX) || defined(SFX_EXDIR)) |
2285 | - static ZCONST char Far NotExtracting[] = |
2286 | - "caution: not extracting; -d ignored\n"; |
2287 | - static ZCONST char Far MustGiveExdir[] = |
2288 | - "error: must specify directory to which to extract with -d option\n"; |
2289 | - static ZCONST char Far OnlyOneExdir[] = |
2290 | - "error: -d option used more than once (only one exdir allowed)\n"; |
2291 | -#endif |
2292 | -#if (defined(UNICODE_SUPPORT) && !defined(UNICODE_WCHAR)) |
2293 | - static ZCONST char Far UTF8EscapeUnSupp[] = |
2294 | - "warning: -U \"escape all non-ASCII UTF-8 chars\" is not supported\n"; |
2295 | -#endif |
2296 | - |
2297 | -#if CRYPT |
2298 | - static ZCONST char Far MustGivePasswd[] = |
2299 | - "error: must give decryption password with -P option\n"; |
2300 | -#endif |
2301 | - |
2302 | -#ifndef SFX |
2303 | - static ZCONST char Far Zfirst[] = |
2304 | - "error: -Z must be first option for ZipInfo mode (check UNZIP variable?)\n"; |
2305 | -#endif |
2306 | -static ZCONST char Far InvalidOptionsMsg[] = "error:\ |
2307 | - -fn or any combination of -c, -l, -p, -t, -u and -v options invalid\n"; |
2308 | -static ZCONST char Far IgnoreOOptionMsg[] = |
2309 | - "caution: both -n and -o specified; ignoring -o\n"; |
2310 | - |
2311 | -/* usage() strings */ |
2312 | -#ifndef SFX |
2313 | -#ifdef VMS |
2314 | - static ZCONST char Far Example3[] = "vms.c"; |
2315 | - static ZCONST char Far Example2[] = " unzip \"-V\" foo \"Bar\"\ |
2316 | - (Quote names to preserve case, unless SET PROC/PARS=EXT)\n"; |
2317 | -#else /* !VMS */ |
2318 | - static ZCONST char Far Example3[] = "ReadMe"; |
2319 | -#ifdef RISCOS |
2320 | - static ZCONST char Far Example2[] = |
2321 | -" unzip foo -d RAM:$ => extract all files from foo into RAMDisc\n"; |
2322 | -#else /* !RISCOS */ |
2323 | -#if (defined(OS2) || (defined(DOS_FLX_OS2_W32) && defined(MORE))) |
2324 | - static ZCONST char Far Example2[] = |
2325 | - ""; /* no room: too many local3[] items */ |
2326 | -#else /* !OS2 */ |
2327 | -#ifdef MACOS |
2328 | - static ZCONST char Far Example2[] = ""; /* not needed */ |
2329 | -#else /* !MACOS */ |
2330 | - static ZCONST char Far Example2[] = " \ |
2331 | - unzip -p foo | more => send contents of foo.zip via pipe into program more\n"; |
2332 | -#endif /* ?MACOS */ |
2333 | -#endif /* ?OS2 */ |
2334 | -#endif /* ?RISCOS */ |
2335 | -#endif /* ?VMS */ |
2336 | - |
2337 | -/* local1[]: command options */ |
2338 | -#if defined(TIMESTAMP) |
2339 | - static ZCONST char Far local1[] = |
2340 | - " -T timestamp archive to latest"; |
2341 | -#else /* !TIMESTAMP */ |
2342 | - static ZCONST char Far local1[] = ""; |
2343 | -#endif /* ?TIMESTAMP */ |
2344 | - |
2345 | -/* local2[] and local3[]: modifier options */ |
2346 | -#ifdef DOS_FLX_H68_OS2_W32 |
2347 | -#ifdef FLEXOS |
2348 | - static ZCONST char Far local2[] = ""; |
2349 | -#else |
2350 | - static ZCONST char Far local2[] = |
2351 | - " -$ label removables (-$$ => fixed disks)"; |
2352 | -#endif |
2353 | -#ifdef OS2 |
2354 | -#ifdef MORE |
2355 | - static ZCONST char Far local3[] = "\ |
2356 | - -X restore ACLs if supported -s spaces in filenames => '_'\n\ |
2357 | - -M pipe through \"more\" pager\n"; |
2358 | -#else |
2359 | - static ZCONST char Far local3[] = " \ |
2360 | - -X restore ACLs if supported -s spaces in filenames => '_'\n\n"; |
2361 | -#endif /* ?MORE */ |
2362 | -#else /* !OS2 */ |
2363 | -#ifdef WIN32 |
2364 | -#ifdef NTSD_EAS |
2365 | -#ifdef MORE |
2366 | - static ZCONST char Far local3[] = "\ |
2367 | - -X restore ACLs (-XX => use privileges) -s spaces in filenames => '_'\n\ |
2368 | - -M pipe through \"more\" pager\n"; |
2369 | -#else |
2370 | - static ZCONST char Far local3[] = " \ |
2371 | - -X restore ACLs (-XX => use privileges) -s spaces in filenames => '_'\n\n"; |
2372 | -#endif /* ?MORE */ |
2373 | -#else /* !NTSD_EAS */ |
2374 | -#ifdef MORE |
2375 | - static ZCONST char Far local3[] = "\ |
2376 | - -M pipe through \"more\" pager \ |
2377 | - -s spaces in filenames => '_'\n\n"; |
2378 | -#else |
2379 | - static ZCONST char Far local3[] = " \ |
2380 | - -s spaces in filenames => '_'\n\n"; |
2381 | -#endif /* ?MORE */ |
2382 | -#endif /* ?NTSD_EAS */ |
2383 | -#else /* !WIN32 */ |
2384 | -#ifdef MORE |
2385 | - static ZCONST char Far local3[] = " -\ |
2386 | -M pipe through \"more\" pager -s spaces in filenames => '_'\n\n"; |
2387 | -#else |
2388 | - static ZCONST char Far local3[] = "\ |
2389 | - -s spaces in filenames => '_'\n"; |
2390 | -#endif |
2391 | -#endif /* ?WIN32 */ |
2392 | -#endif /* ?OS2 || ?WIN32 */ |
2393 | -#else /* !DOS_FLX_OS2_W32 */ |
2394 | -#ifdef VMS |
2395 | - static ZCONST char Far local2[] = " -X restore owner/ACL protection info"; |
2396 | -#ifdef MORE |
2397 | - static ZCONST char Far local3[] = "\ |
2398 | - -Y treat \".nnn\" as \";nnn\" version -2 force ODS2 names\n\ |
2399 | - --D restore dir (-D: no) timestamps -M pipe through \"more\" pager\n\ |
2400 | - (Must quote upper-case options, like \"-V\", unless SET PROC/PARSE=EXTEND.)\ |
2401 | -\n\n"; |
2402 | -#else |
2403 | - static ZCONST char Far local3[] = "\n\ |
2404 | - -Y treat \".nnn\" as \";nnn\" version -2 force ODS2 names\n\ |
2405 | - --D restore dir (-D: no) timestamps\n\ |
2406 | - (Must quote upper-case options, like \"-V\", unless SET PROC/PARSE=EXTEND.)\ |
2407 | -\n\n"; |
2408 | -#endif |
2409 | -#else /* !VMS */ |
2410 | -#ifdef ATH_BEO_UNX |
2411 | - static ZCONST char Far local2[] = " -X restore UID/GID info"; |
2412 | -#ifdef MORE |
2413 | - static ZCONST char Far local3[] = "\ |
2414 | - -K keep setuid/setgid/tacky permissions -M pipe through \"more\" pager\n"; |
2415 | -#else |
2416 | - static ZCONST char Far local3[] = "\ |
2417 | - -K keep setuid/setgid/tacky permissions\n"; |
2418 | -#endif |
2419 | -#else /* !ATH_BEO_UNX */ |
2420 | -#ifdef TANDEM |
2421 | - static ZCONST char Far local2[] = "\ |
2422 | - -X restore Tandem User ID -r remove file extensions\n\ |
2423 | - -b create 'C' (180) text files "; |
2424 | -#ifdef MORE |
2425 | - static ZCONST char Far local3[] = " \ |
2426 | - -M pipe through \"more\" pager\n"; |
2427 | -#else |
2428 | - static ZCONST char Far local3[] = "\n"; |
2429 | -#endif |
2430 | -#else /* !TANDEM */ |
2431 | -#ifdef AMIGA |
2432 | - static ZCONST char Far local2[] = " -N restore comments as filenotes"; |
2433 | -#ifdef MORE |
2434 | - static ZCONST char Far local3[] = " \ |
2435 | - -M pipe through \"more\" pager\n"; |
2436 | -#else |
2437 | - static ZCONST char Far local3[] = "\n"; |
2438 | -#endif |
2439 | -#else /* !AMIGA */ |
2440 | -#ifdef MACOS |
2441 | - static ZCONST char Far local2[] = " -E show Mac info during extraction"; |
2442 | - static ZCONST char Far local3[] = " \ |
2443 | - -i ignore filenames in mac extra info -J junk (ignore) Mac extra info\n\ |
2444 | -\n"; |
2445 | -#else /* !MACOS */ |
2446 | -#ifdef MORE |
2447 | - static ZCONST char Far local2[] = " -M pipe through \"more\" pager"; |
2448 | - static ZCONST char Far local3[] = "\n"; |
2449 | -#else |
2450 | - static ZCONST char Far local2[] = ""; /* Atari, Mac, CMS/MVS etc. */ |
2451 | - static ZCONST char Far local3[] = ""; |
2452 | -#endif |
2453 | -#endif /* ?MACOS */ |
2454 | -#endif /* ?AMIGA */ |
2455 | -#endif /* ?TANDEM */ |
2456 | -#endif /* ?ATH_BEO_UNX */ |
2457 | -#endif /* ?VMS */ |
2458 | -#endif /* ?DOS_FLX_OS2_W32 */ |
2459 | -#endif /* !SFX */ |
2460 | - |
2461 | -#ifndef NO_ZIPINFO |
2462 | -#ifdef VMS |
2463 | - static ZCONST char Far ZipInfoExample[] = "* or % (e.g., \"*font-%.zip\")"; |
2464 | -#else |
2465 | - static ZCONST char Far ZipInfoExample[] = "*, ?, [] (e.g., \"[a-j]*.zip\")"; |
2466 | -#endif |
2467 | - |
2468 | -static ZCONST char Far ZipInfoUsageLine1[] = "\ |
2469 | -ZipInfo %d.%d%d%s of %s, by Greg Roelofs and the Info-ZIP group.\n\ |
2470 | -\n\ |
2471 | -List name, date/time, attribute, size, compression method, etc., about files\n\ |
2472 | -in list (excluding those in xlist) contained in the specified .zip archive(s).\ |
2473 | -\n\"file[.zip]\" may be a wildcard name containing %s.\n\n\ |
2474 | - usage: zipinfo [-12smlvChMtTz] file[.zip] [list...] [-x xlist...]\n\ |
2475 | - or: unzip %s-Z%s [-12smlvChMtTz] file[.zip] [list...] [-x xlist...]\n"; |
2476 | - |
2477 | -static ZCONST char Far ZipInfoUsageLine2[] = "\nmain\ |
2478 | - listing-format options: -s short Unix \"ls -l\" format (def.)\n\ |
2479 | - -1 filenames ONLY, one per line -m medium Unix \"ls -l\" format\n\ |
2480 | - -2 just filenames but allow -h/-t/-z -l long Unix \"ls -l\" format\n\ |
2481 | - -v verbose, multi-page format\n"; |
2482 | - |
2483 | -static ZCONST char Far ZipInfoUsageLine3[] = "miscellaneous options:\n\ |
2484 | - -h print header line -t print totals for listed files or for all\n\ |
2485 | - -z print zipfile comment -T print file times in sortable decimal format\ |
2486 | -\n -C be case-insensitive %s\ |
2487 | - -x exclude filenames that follow from listing\n"; |
2488 | -#ifdef MORE |
2489 | - static ZCONST char Far ZipInfoUsageLine4[] = |
2490 | - " -M page output through built-in \"more\"\n"; |
2491 | -#else /* !MORE */ |
2492 | - static ZCONST char Far ZipInfoUsageLine4[] = ""; |
2493 | -#endif /* ?MORE */ |
2494 | -#endif /* !NO_ZIPINFO */ |
2495 | - |
2496 | -#ifdef BETA |
2497 | -# ifdef VMSCLI |
2498 | - /* BetaVersion[] is also used in vms/cmdline.c: do not make it static */ |
2499 | - ZCONST char Far BetaVersion[] = "%s\ |
2500 | - THIS IS STILL A BETA VERSION OF UNZIP%s -- DO NOT DISTRIBUTE.\n\n"; |
2501 | -# else |
2502 | - static ZCONST char Far BetaVersion[] = "%s\ |
2503 | - THIS IS STILL A BETA VERSION OF UNZIP%s -- DO NOT DISTRIBUTE.\n\n"; |
2504 | -# endif |
2505 | -#endif |
2506 | - |
2507 | -#ifdef SFX |
2508 | -# ifdef VMSCLI |
2509 | - /* UnzipSFXBanner[] is also used in vms/cmdline.c: do not make it static */ |
2510 | - ZCONST char Far UnzipSFXBanner[] = |
2511 | -# else |
2512 | - static ZCONST char Far UnzipSFXBanner[] = |
2513 | -# endif |
2514 | - "UnZipSFX %d.%d%d%s of %s, by Info-ZIP (http://www.info-zip.org).\n"; |
2515 | -# ifdef SFX_EXDIR |
2516 | - static ZCONST char Far UnzipSFXOpts[] = |
2517 | - "Valid options are -tfupcz and -d <exdir>; modifiers are -abjnoqCL%sV%s.\n"; |
2518 | -# else |
2519 | - static ZCONST char Far UnzipSFXOpts[] = |
2520 | - "Valid options are -tfupcz; modifiers are -abjnoqCL%sV%s.\n"; |
2521 | -# endif |
2522 | -#else /* !SFX */ |
2523 | - static ZCONST char Far CompileOptions[] = |
2524 | - "UnZip special compilation options:\n"; |
2525 | - static ZCONST char Far CompileOptFormat[] = " %s\n"; |
2526 | -#ifndef _WIN32_WCE /* Win CE does not support environment variables */ |
2527 | - static ZCONST char Far EnvOptions[] = |
2528 | - "\nUnZip and ZipInfo environment options:\n"; |
2529 | - static ZCONST char Far EnvOptFormat[] = "%16s: %.1024s\n"; |
2530 | -#endif |
2531 | - static ZCONST char Far None[] = "[none]"; |
2532 | -# ifdef ACORN_FTYPE_NFS |
2533 | - static ZCONST char Far AcornFtypeNFS[] = "ACORN_FTYPE_NFS"; |
2534 | -# endif |
2535 | -# ifdef ASM_CRC |
2536 | - static ZCONST char Far AsmCRC[] = "ASM_CRC"; |
2537 | -# endif |
2538 | -# ifdef ASM_INFLATECODES |
2539 | - static ZCONST char Far AsmInflateCodes[] = "ASM_INFLATECODES"; |
2540 | -# endif |
2541 | -# ifdef CHECK_VERSIONS |
2542 | - static ZCONST char Far Check_Versions[] = "CHECK_VERSIONS"; |
2543 | -# endif |
2544 | -# ifdef COPYRIGHT_CLEAN |
2545 | - static ZCONST char Far Copyright_Clean[] = |
2546 | - "COPYRIGHT_CLEAN (PKZIP 0.9x unreducing method not supported)"; |
2547 | -# endif |
2548 | -# ifdef DEBUG |
2549 | - static ZCONST char Far UDebug[] = "DEBUG"; |
2550 | -# endif |
2551 | -# ifdef DEBUG_TIME |
2552 | - static ZCONST char Far DebugTime[] = "DEBUG_TIME"; |
2553 | -# endif |
2554 | -# ifdef DLL |
2555 | - static ZCONST char Far Dll[] = "DLL"; |
2556 | -# endif |
2557 | -# ifdef DOSWILD |
2558 | - static ZCONST char Far DosWild[] = "DOSWILD"; |
2559 | -# endif |
2560 | -# ifdef LZW_CLEAN |
2561 | - static ZCONST char Far LZW_Clean[] = |
2562 | - "LZW_CLEAN (PKZIP/Zip 1.x unshrinking method not supported)"; |
2563 | -# endif |
2564 | -# ifndef MORE |
2565 | - static ZCONST char Far No_More[] = "NO_MORE"; |
2566 | -# endif |
2567 | -# ifdef NO_ZIPINFO |
2568 | - static ZCONST char Far No_ZipInfo[] = "NO_ZIPINFO"; |
2569 | -# endif |
2570 | -# ifdef NTSD_EAS |
2571 | - static ZCONST char Far NTSDExtAttrib[] = "NTSD_EAS"; |
2572 | -# endif |
2573 | -# if defined(WIN32) && defined(NO_W32TIMES_IZFIX) |
2574 | - static ZCONST char Far W32NoIZTimeFix[] = "NO_W32TIMES_IZFIX"; |
2575 | -# endif |
2576 | -# ifdef OLD_THEOS_EXTRA |
2577 | - static ZCONST char Far OldTheosExtra[] = |
2578 | - "OLD_THEOS_EXTRA (handle also old Theos port extra field)"; |
2579 | -# endif |
2580 | -# ifdef OS2_EAS |
2581 | - static ZCONST char Far OS2ExtAttrib[] = "OS2_EAS"; |
2582 | -# endif |
2583 | -# ifdef QLZIP |
2584 | - static ZCONST char Far SMSExFldOnUnix[] = "QLZIP"; |
2585 | -# endif |
2586 | -# ifdef REENTRANT |
2587 | - static ZCONST char Far Reentrant[] = "REENTRANT"; |
2588 | -# endif |
2589 | -# ifdef REGARGS |
2590 | - static ZCONST char Far RegArgs[] = "REGARGS"; |
2591 | -# endif |
2592 | -# ifdef RETURN_CODES |
2593 | - static ZCONST char Far Return_Codes[] = "RETURN_CODES"; |
2594 | -# endif |
2595 | -# ifdef SET_DIR_ATTRIB |
2596 | - static ZCONST char Far SetDirAttrib[] = "SET_DIR_ATTRIB"; |
2597 | -# endif |
2598 | -# ifdef SYMLINKS |
2599 | - static ZCONST char Far SymLinkSupport[] = |
2600 | - "SYMLINKS (symbolic links supported, if RTL and file system permit)"; |
2601 | -# endif |
2602 | -# ifdef TIMESTAMP |
2603 | - static ZCONST char Far TimeStamp[] = "TIMESTAMP"; |
2604 | -# endif |
2605 | -# ifdef UNIXBACKUP |
2606 | - static ZCONST char Far UnixBackup[] = "UNIXBACKUP"; |
2607 | -# endif |
2608 | -# ifdef USE_EF_UT_TIME |
2609 | - static ZCONST char Far Use_EF_UT_time[] = "USE_EF_UT_TIME"; |
2610 | -# endif |
2611 | -# ifndef LZW_CLEAN |
2612 | - static ZCONST char Far Use_Unshrink[] = |
2613 | - "USE_UNSHRINK (PKZIP/Zip 1.x unshrinking method supported)"; |
2614 | -# endif |
2615 | -# ifndef COPYRIGHT_CLEAN |
2616 | - static ZCONST char Far Use_Smith_Code[] = |
2617 | - "USE_SMITH_CODE (PKZIP 0.9x unreducing method supported)"; |
2618 | -# endif |
2619 | -# ifdef USE_DEFLATE64 |
2620 | - static ZCONST char Far Use_Deflate64[] = |
2621 | - "USE_DEFLATE64 (PKZIP 4.x Deflate64(tm) supported)"; |
2622 | -# endif |
2623 | -# ifdef UNICODE_SUPPORT |
2624 | -# ifdef UTF8_MAYBE_NATIVE |
2625 | -# ifdef UNICODE_WCHAR |
2626 | - /* direct native UTF-8 check AND charset transform via wchar_t */ |
2627 | - static ZCONST char Far Use_Unicode[] = |
2628 | - "UNICODE_SUPPORT [wide-chars, char coding: %s] (handle UTF-8 paths)"; |
2629 | -# else |
2630 | - /* direct native UTF-8 check, only */ |
2631 | - static ZCONST char Far Use_Unicode[] = |
2632 | - "UNICODE_SUPPORT [char coding: %s] (handle UTF-8 paths)"; |
2633 | -# endif |
2634 | - static ZCONST char Far SysChUTF8[] = "UTF-8"; |
2635 | - static ZCONST char Far SysChOther[] = "other"; |
2636 | -# else /* !UTF8_MAYBE_NATIVE */ |
2637 | - /* charset transform via wchar_t, no native UTF-8 support */ |
2638 | - static ZCONST char Far Use_Unicode[] = |
2639 | - "UNICODE_SUPPORT [wide-chars] (handle UTF-8 paths)"; |
2640 | -# endif /* ?UTF8_MAYBE_NATIVE */ |
2641 | -# endif /* UNICODE_SUPPORT */ |
2642 | -# ifdef _MBCS |
2643 | - static ZCONST char Far Have_MBCS_Support[] = |
2644 | - "MBCS-support (multibyte character support, MB_CUR_MAX = %u)"; |
2645 | -# endif |
2646 | -# ifdef MULT_VOLUME |
2647 | - static ZCONST char Far Use_MultiVol[] = |
2648 | - "MULT_VOLUME (multi-volume archives supported)"; |
2649 | -# endif |
2650 | -# ifdef LARGE_FILE_SUPPORT |
2651 | - static ZCONST char Far Use_LFS[] = |
2652 | - "LARGE_FILE_SUPPORT (large files over 2 GiB supported)"; |
2653 | -# endif |
2654 | -# ifdef ZIP64_SUPPORT |
2655 | - static ZCONST char Far Use_Zip64[] = |
2656 | - "ZIP64_SUPPORT (archives using Zip64 for large files supported)"; |
2657 | -# endif |
2658 | -# if (defined(__DJGPP__) && (__DJGPP__ >= 2)) |
2659 | -# ifdef USE_DJGPP_ENV |
2660 | - static ZCONST char Far Use_DJGPP_Env[] = "USE_DJGPP_ENV"; |
2661 | -# endif |
2662 | -# ifdef USE_DJGPP_GLOB |
2663 | - static ZCONST char Far Use_DJGPP_Glob[] = "USE_DJGPP_GLOB"; |
2664 | -# endif |
2665 | -# endif /* __DJGPP__ && (__DJGPP__ >= 2) */ |
2666 | -# ifdef USE_VFAT |
2667 | - static ZCONST char Far Use_VFAT_support[] = "USE_VFAT"; |
2668 | -# endif |
2669 | -# ifdef USE_ZLIB |
2670 | - static ZCONST char Far UseZlib[] = |
2671 | - "USE_ZLIB (compiled with version %s; using version %s)"; |
2672 | -# endif |
2673 | -# ifdef USE_BZIP2 |
2674 | - static ZCONST char Far UseBZip2[] = |
2675 | - "USE_BZIP2 (PKZIP 4.6+, using bzip2 lib version %s)"; |
2676 | -# endif |
2677 | -# ifdef VMS_TEXT_CONV |
2678 | - static ZCONST char Far VmsTextConv[] = "VMS_TEXT_CONV"; |
2679 | -# endif |
2680 | -# ifdef VMSCLI |
2681 | - static ZCONST char Far VmsCLI[] = "VMSCLI"; |
2682 | -# endif |
2683 | -# ifdef VMSWILD |
2684 | - static ZCONST char Far VmsWild[] = "VMSWILD"; |
2685 | -# endif |
2686 | -# ifdef WILD_STOP_AT_DIR |
2687 | - static ZCONST char Far WildStopAtDir[] = "WILD_STOP_AT_DIR"; |
2688 | -# endif |
2689 | -# if CRYPT |
2690 | -# ifdef PASSWD_FROM_STDIN |
2691 | - static ZCONST char Far PasswdStdin[] = "PASSWD_FROM_STDIN"; |
2692 | -# endif |
2693 | - static ZCONST char Far Decryption[] = |
2694 | - " [decryption, version %d.%d%s of %s]\n"; |
2695 | - static ZCONST char Far CryptDate[] = CR_VERSION_DATE; |
2696 | -# endif |
2697 | -# ifndef __RSXNT__ |
2698 | -# ifdef __EMX__ |
2699 | - static ZCONST char Far EnvEMX[] = "EMX"; |
2700 | - static ZCONST char Far EnvEMXOPT[] = "EMXOPT"; |
2701 | -# endif |
2702 | -# if (defined(__GO32__) && (!defined(__DJGPP__) || (__DJGPP__ < 2))) |
2703 | - static ZCONST char Far EnvGO32[] = "GO32"; |
2704 | - static ZCONST char Far EnvGO32TMP[] = "GO32TMP"; |
2705 | -# endif |
2706 | -# endif /* !__RSXNT__ */ |
2707 | - |
2708 | -#ifdef VMS |
2709 | -/* UnzipUsageLine1[] is also used in vms/cmdline.c: do not make it static */ |
2710 | - ZCONST char Far UnzipUsageLine1[] = "\ |
2711 | -UnZip %d.%d%d%s of %s, by Info-ZIP. For more details see: unzip -v.\n\n"; |
2712 | -# ifdef COPYRIGHT_CLEAN |
2713 | - static ZCONST char Far UnzipUsageLine1v[] = "\ |
2714 | -UnZip %d.%d%d%s of %s, by Info-ZIP. Maintained by C. Spieler. Send\n\ |
2715 | -bug reports using http://www.info-zip.org/zip-bug.html; see README for details.\ |
2716 | -\n\n"; |
2717 | -# else |
2718 | - static ZCONST char Far UnzipUsageLine1v[] = "\ |
2719 | -UnZip %d.%d%d%s of %s, by Info-ZIP. UnReduce (c) 1989 by S. H. Smith.\n\ |
2720 | -Send bug reports using //www.info-zip.org/zip-bug.html; see README for details.\ |
2721 | -\n\n"; |
2722 | -# endif /* ?COPYRIGHT_CLEAN */ |
2723 | -#else /* !VMS */ |
2724 | -# ifdef COPYRIGHT_CLEAN |
2725 | - static ZCONST char Far UnzipUsageLine1[] = "\ |
2726 | -UnZip %d.%d%d%s of %s, by Info-ZIP. Maintained by C. Spieler. Send\n\ |
2727 | -bug reports using http://www.info-zip.org/zip-bug.html; see README for details.\ |
2728 | -\n\n"; |
2729 | -# else |
2730 | - static ZCONST char Far UnzipUsageLine1[] = "\ |
2731 | -UnZip %d.%d%d%s of %s, by Info-ZIP. UnReduce (c) 1989 by S. H. Smith.\n\ |
2732 | -Send bug reports using //www.info-zip.org/zip-bug.html; see README for details.\ |
2733 | -\n\n"; |
2734 | -# endif /* ?COPYRIGHT_CLEAN */ |
2735 | -# define UnzipUsageLine1v UnzipUsageLine1 |
2736 | -#endif /* ?VMS */ |
2737 | - |
2738 | -static ZCONST char Far UnzipUsageLine2v[] = "\ |
2739 | -Latest sources and executables are at ftp://ftp.info-zip.org/pub/infozip/ ;\ |
2740 | -\nsee ftp://ftp.info-zip.org/pub/infozip/UnZip.html for other sites.\ |
2741 | -\n\n"; |
2742 | - |
2743 | -#ifdef MACOS |
2744 | -static ZCONST char Far UnzipUsageLine2[] = "\ |
2745 | -Usage: unzip %s[-opts[modifiers]] file[.zip] [list] [-d exdir]\n \ |
2746 | - Default action is to extract files in list, to exdir;\n\ |
2747 | - file[.zip] may be a wildcard. %s\n"; |
2748 | -#else /* !MACOS */ |
2749 | -#ifdef VM_CMS |
2750 | -static ZCONST char Far UnzipUsageLine2[] = "\ |
2751 | -Usage: unzip %s[-opts[modifiers]] file[.zip] [list] [-x xlist] [-d fm]\n \ |
2752 | - Default action is to extract files in list, except those in xlist, to disk fm;\ |
2753 | -\n file[.zip] may be a wildcard. %s\n"; |
2754 | -#else /* !VM_CMS */ |
2755 | -static ZCONST char Far UnzipUsageLine2[] = "\ |
2756 | -Usage: unzip %s[-opts[modifiers]] file[.zip] [list] [-x xlist] [-d exdir]\n \ |
2757 | - Default action is to extract files in list, except those in xlist, to exdir;\n\ |
2758 | - file[.zip] may be a wildcard. %s\n"; |
2759 | -#endif /* ?VM_CMS */ |
2760 | -#endif /* ?MACOS */ |
2761 | - |
2762 | -#ifdef NO_ZIPINFO |
2763 | -# define ZIPINFO_MODE_OPTION "" |
2764 | - static ZCONST char Far ZipInfoMode[] = |
2765 | - "(ZipInfo mode is disabled in this version.)"; |
2766 | -#else |
2767 | -# define ZIPINFO_MODE_OPTION "[-Z] " |
2768 | - static ZCONST char Far ZipInfoMode[] = |
2769 | - "-Z => ZipInfo mode (\"unzip -Z\" for usage)."; |
2770 | -#endif /* ?NO_ZIPINFO */ |
2771 | - |
2772 | -#ifdef VMS |
2773 | - static ZCONST char Far VMSusageLine2b[] = "\ |
2774 | -=> define foreign command symbol in LOGIN.COM: $ unzip :== $dev:[dir]unzip.exe\ |
2775 | -\n"; |
2776 | -#endif |
2777 | - |
2778 | -#ifdef MACOS |
2779 | -static ZCONST char Far UnzipUsageLine3[] = "\n\ |
2780 | - -d extract files into exdir -l list files (short format)\n\ |
2781 | - -f freshen existing files, create none -t test compressed archive data\n\ |
2782 | - -u update files, create if necessary -z display archive comment only\n\ |
2783 | - -v list verbosely/show version info %s\n"; |
2784 | -#else /* !MACOS */ |
2785 | -#ifdef VM_CMS |
2786 | -static ZCONST char Far UnzipUsageLine3[] = "\n\ |
2787 | - -p extract files to pipe, no messages -l list files (short format)\n\ |
2788 | - -f freshen existing files, create none -t test compressed archive data\n\ |
2789 | - -u update files, create if necessary -z display archive comment only\n\ |
2790 | - -v list verbosely/show version info %s\n\ |
2791 | - -x exclude files that follow (in xlist) -d extract files onto disk fm\n"; |
2792 | -#else /* !VM_CMS */ |
2793 | -static ZCONST char Far UnzipUsageLine3[] = "\n\ |
2794 | - -p extract files to pipe, no messages -l list files (short format)\n\ |
2795 | - -f freshen existing files, create none -t test compressed archive data\n\ |
2796 | - -u update files, create if necessary -z display archive comment only\n\ |
2797 | - -v list verbosely/show version info %s\n\ |
2798 | - -x exclude files that follow (in xlist) -d extract files into exdir\n"; |
2799 | -#endif /* ?VM_CMS */ |
2800 | -#endif /* ?MACOS */ |
2801 | - |
2802 | -/* There is not enough space on a standard 80x25 Windows console screen for |
2803 | - * the additional line advertising the UTF-8 debugging options. This may |
2804 | - * eventually also be the case for other ports. Probably, the -U option need |
2805 | - * not be shown on the introductory screen at all. [Chr. Spieler, 2008-02-09] |
2806 | - * |
2807 | - * Likely, other advanced options should be moved to an extended help page and |
2808 | - * the option to list that page put here. [E. Gordon, 2008-3-16] |
2809 | - */ |
2810 | -#if (defined(UNICODE_SUPPORT) && !defined(WIN32)) |
2811 | -#ifdef VMS |
2812 | -static ZCONST char Far UnzipUsageLine4[] = "\ |
2813 | -modifiers:\n\ |
2814 | - -n never overwrite or make a new version of an existing file\n\ |
2815 | - -o always make a new version (-oo: overwrite original) of an existing file\n\ |
2816 | - -q quiet mode (-qq => quieter) -a auto-convert any text files\n\ |
2817 | - -j junk paths (do not make directories) -aa treat ALL files as text\n\ |
2818 | - -U use escapes for all non-ASCII Unicode -UU ignore any Unicode fields\n\ |
2819 | - -C match filenames case-insensitively -L make (some) names \ |
2820 | -lowercase\n %-42s -V retain VMS version numbers\n%s"; |
2821 | -#else /* !VMS */ |
2822 | -static ZCONST char Far UnzipUsageLine4[] = "\ |
2823 | -modifiers:\n\ |
2824 | - -n never overwrite existing files -q quiet mode (-qq => quieter)\n\ |
2825 | - -o overwrite files WITHOUT prompting -a auto-convert any text files\n\ |
2826 | - -j junk paths (do not make directories) -aa treat ALL files as text\n\ |
2827 | - -U use escapes for all non-ASCII Unicode -UU ignore any Unicode fields\n\ |
2828 | - -C match filenames case-insensitively -L make (some) names \ |
2829 | -lowercase\n %-42s -V retain VMS version numbers\n%s"; |
2830 | -#endif /* ?VMS */ |
2831 | -#else /* !UNICODE_SUPPORT */ |
2832 | -#ifdef VMS |
2833 | -static ZCONST char Far UnzipUsageLine4[] = "\ |
2834 | -modifiers:\n\ |
2835 | - -n never overwrite or make a new version of an existing file\n\ |
2836 | - -o always make a new version (-oo: overwrite original) of an existing file\n\ |
2837 | - -q quiet mode (-qq => quieter) -a auto-convert any text files\n\ |
2838 | - -j junk paths (do not make directories) -aa treat ALL files as text\n\ |
2839 | - -C match filenames case-insensitively -L make (some) names \ |
2840 | -lowercase\n %-42s -V retain VMS version numbers\n%s"; |
2841 | -#else /* !VMS */ |
2842 | -static ZCONST char Far UnzipUsageLine4[] = "\ |
2843 | -modifiers:\n\ |
2844 | - -n never overwrite existing files -q quiet mode (-qq => quieter)\n\ |
2845 | - -o overwrite files WITHOUT prompting -a auto-convert any text files\n\ |
2846 | - -j junk paths (do not make directories) -aa treat ALL files as text\n\ |
2847 | - -C match filenames case-insensitively -L make (some) names \ |
2848 | -lowercase\n %-42s -V retain VMS version numbers\n%s"; |
2849 | -#endif /* ?VMS */ |
2850 | -#endif /* ?UNICODE_SUPPORT */ |
2851 | - |
2852 | -static ZCONST char Far UnzipUsageLine5[] = "\ |
2853 | -See \"unzip -hh\" or unzip.txt for more help. Examples:\n\ |
2854 | - unzip data1 -x joe => extract all files except joe from zipfile data1.zip\n\ |
2855 | -%s\ |
2856 | - unzip -fo foo %-6s => quietly replace existing %s if archive file newer\n"; |
2857 | -#endif /* ?SFX */ |
2858 | - |
2859 | - |
2860 | - |
2861 | - |
2862 | - |
2863 | -/*****************************/ |
2864 | -/* main() / UzpMain() stub */ |
2865 | -/*****************************/ |
2866 | - |
2867 | -int MAIN(argc, argv) /* return PK-type error code (except under VMS) */ |
2868 | - int argc; |
2869 | - char *argv[]; |
2870 | -{ |
2871 | - int r; |
2872 | - |
2873 | - CONSTRUCTGLOBALS(); |
2874 | - r = unzip(__G__ argc, argv); |
2875 | - DESTROYGLOBALS(); |
2876 | - RETURN(r); |
2877 | -} |
2878 | - |
2879 | - |
2880 | - |
2881 | - |
2882 | -/*******************************/ |
2883 | -/* Primary UnZip entry point */ |
2884 | -/*******************************/ |
2885 | - |
2886 | -int unzip(__G__ argc, argv) |
2887 | - __GDEF |
2888 | - int argc; |
2889 | - char *argv[]; |
2890 | -{ |
2891 | -#ifndef NO_ZIPINFO |
2892 | - char *p; |
2893 | -#endif |
2894 | -#if (defined(DOS_FLX_H68_NLM_OS2_W32) || !defined(SFX)) |
2895 | - int i; |
2896 | -#endif |
2897 | - int retcode, error=FALSE; |
2898 | -#ifndef NO_EXCEPT_SIGNALS |
2899 | -#ifdef REENTRANT |
2900 | - savsigs_info *oldsighandlers = NULL; |
2901 | -# define SET_SIGHANDLER(sigtype, newsighandler) \ |
2902 | - if ((retcode = setsignalhandler(__G__ &oldsighandlers, (sigtype), \ |
2903 | - (newsighandler))) > PK_WARN) \ |
2904 | - goto cleanup_and_exit |
2905 | -#else |
2906 | -# define SET_SIGHANDLER(sigtype, newsighandler) \ |
2907 | - signal((sigtype), (newsighandler)) |
2908 | -#endif |
2909 | -#endif /* NO_EXCEPT_SIGNALS */ |
2910 | - |
2911 | - /* initialize international char support to the current environment */ |
2912 | - SETLOCALE(LC_CTYPE, ""); |
2913 | - |
2914 | -#ifdef UNICODE_SUPPORT |
2915 | - /* see if can use UTF-8 Unicode locale */ |
2916 | -# ifdef UTF8_MAYBE_NATIVE |
2917 | - { |
2918 | - char *codeset; |
2919 | -# if !(defined(NO_NL_LANGINFO) || defined(NO_LANGINFO_H)) |
2920 | - /* get the codeset (character set encoding) currently used */ |
2921 | -# include <langinfo.h> |
2922 | - |
2923 | - codeset = nl_langinfo(CODESET); |
2924 | -# else /* NO_NL_LANGINFO || NO_LANGINFO_H */ |
2925 | - /* query the current locale setting for character classification */ |
2926 | - codeset = setlocale(LC_CTYPE, NULL); |
2927 | - if (codeset != NULL) { |
2928 | - /* extract the codeset portion of the locale name */ |
2929 | - codeset = strchr(codeset, '.'); |
2930 | - if (codeset != NULL) ++codeset; |
2931 | - } |
2932 | -# endif /* ?(NO_NL_LANGINFO || NO_LANGINFO_H) */ |
2933 | - /* is the current codeset UTF-8 ? */ |
2934 | - if ((codeset != NULL) && (strcmp(codeset, "UTF-8") == 0)) { |
2935 | - /* successfully found UTF-8 char coding */ |
2936 | - G.native_is_utf8 = TRUE; |
2937 | - } else { |
2938 | - /* Current codeset is not UTF-8 or cannot be determined. */ |
2939 | - G.native_is_utf8 = FALSE; |
2940 | - } |
2941 | - /* Note: At least for UnZip, trying to change the process codeset to |
2942 | - * UTF-8 does not work. For the example Linux setup of the |
2943 | - * UnZip maintainer, a successful switch to "en-US.UTF-8" |
2944 | - * resulted in garbage display of all non-basic ASCII characters. |
2945 | - */ |
2946 | - } |
2947 | -# endif /* UTF8_MAYBE_NATIVE */ |
2948 | - |
2949 | - /* initialize Unicode */ |
2950 | - G.unicode_escape_all = 0; |
2951 | - G.unicode_mismatch = 0; |
2952 | - |
2953 | - G.unipath_version = 0; |
2954 | - G.unipath_checksum = 0; |
2955 | - G.unipath_filename = NULL; |
2956 | -#endif /* UNICODE_SUPPORT */ |
2957 | - |
2958 | - |
2959 | -#if (defined(__IBMC__) && defined(__DEBUG_ALLOC__)) |
2960 | - extern void DebugMalloc(void); |
2961 | - |
2962 | - atexit(DebugMalloc); |
2963 | -#endif |
2964 | - |
2965 | -#ifdef MALLOC_WORK |
2966 | - /* The following (rather complex) expression determines the allocation |
2967 | - size of the decompression work area. It simulates what the |
2968 | - combined "union" and "struct" declaration of the "static" work |
2969 | - area reservation achieves automatically at compile time. |
2970 | - Any decent compiler should evaluate this expression completely at |
2971 | - compile time and provide constants to the zcalloc() call. |
2972 | - (For better readability, some subexpressions are encapsulated |
2973 | - in temporarly defined macros.) |
2974 | - */ |
2975 | -# define UZ_SLIDE_CHUNK (sizeof(shrint)+sizeof(uch)+sizeof(uch)) |
2976 | -# define UZ_NUMOF_CHUNKS \ |
2977 | - (unsigned)(((WSIZE+UZ_SLIDE_CHUNK-1)/UZ_SLIDE_CHUNK > HSIZE) ? \ |
2978 | - (WSIZE+UZ_SLIDE_CHUNK-1)/UZ_SLIDE_CHUNK : HSIZE) |
2979 | - G.area.Slide = (uch *)zcalloc(UZ_NUMOF_CHUNKS, UZ_SLIDE_CHUNK); |
2980 | -# undef UZ_SLIDE_CHUNK |
2981 | -# undef UZ_NUMOF_CHUNKS |
2982 | - G.area.shrink.Parent = (shrint *)G.area.Slide; |
2983 | - G.area.shrink.value = G.area.Slide + (sizeof(shrint)*(HSIZE)); |
2984 | - G.area.shrink.Stack = G.area.Slide + |
2985 | - (sizeof(shrint) + sizeof(uch))*(HSIZE); |
2986 | -#endif |
2987 | - |
2988 | -/*--------------------------------------------------------------------------- |
2989 | - Set signal handler for restoring echo, warn of zipfile corruption, etc. |
2990 | - ---------------------------------------------------------------------------*/ |
2991 | -#ifndef NO_EXCEPT_SIGNALS |
2992 | -#ifdef SIGINT |
2993 | - SET_SIGHANDLER(SIGINT, handler); |
2994 | -#endif |
2995 | -#ifdef SIGTERM /* some systems really have no SIGTERM */ |
2996 | - SET_SIGHANDLER(SIGTERM, handler); |
2997 | -#endif |
2998 | -#if defined(SIGABRT) && !(defined(AMIGA) && defined(__SASC)) |
2999 | - SET_SIGHANDLER(SIGABRT, handler); |
3000 | -#endif |
3001 | -#ifdef SIGBREAK |
3002 | - SET_SIGHANDLER(SIGBREAK, handler); |
3003 | -#endif |
3004 | -#ifdef SIGBUS |
3005 | - SET_SIGHANDLER(SIGBUS, handler); |
3006 | -#endif |
3007 | -#ifdef SIGILL |
3008 | - SET_SIGHANDLER(SIGILL, handler); |
3009 | -#endif |
3010 | -#ifdef SIGSEGV |
3011 | - SET_SIGHANDLER(SIGSEGV, handler); |
3012 | -#endif |
3013 | -#endif /* NO_EXCEPT_SIGNALS */ |
3014 | - |
3015 | -#if (defined(WIN32) && defined(__RSXNT__)) |
3016 | - for (i = 0 ; i < argc; i++) { |
3017 | - _ISO_INTERN(argv[i]); |
3018 | - } |
3019 | -#endif |
3020 | - |
3021 | -/*--------------------------------------------------------------------------- |
3022 | - Macintosh initialization code. |
3023 | - ---------------------------------------------------------------------------*/ |
3024 | - |
3025 | -#ifdef MACOS |
3026 | - { |
3027 | - int a; |
3028 | - |
3029 | - for (a = 0; a < 4; ++a) |
3030 | - G.rghCursor[a] = GetCursor(a+128); |
3031 | - G.giCursor = 0; |
3032 | - } |
3033 | -#endif |
3034 | - |
3035 | -/*--------------------------------------------------------------------------- |
3036 | - NetWare initialization code. |
3037 | - ---------------------------------------------------------------------------*/ |
3038 | - |
3039 | -#ifdef NLM |
3040 | - InitUnZipConsole(); |
3041 | -#endif |
3042 | - |
3043 | -/*--------------------------------------------------------------------------- |
3044 | - Acorn RISC OS initialization code. |
3045 | - ---------------------------------------------------------------------------*/ |
3046 | - |
3047 | -#ifdef RISCOS |
3048 | - set_prefix(); |
3049 | -#endif |
3050 | - |
3051 | -/*--------------------------------------------------------------------------- |
3052 | - Theos initialization code. |
3053 | - ---------------------------------------------------------------------------*/ |
3054 | - |
3055 | -#ifdef THEOS |
3056 | - /* The easiest way found to force creation of libraries when selected |
3057 | - * members are to be unzipped. Explicitly add libraries names to the |
3058 | - * arguments list before the first member of the library. |
3059 | - */ |
3060 | - if (! _setargv(&argc, &argv)) { |
3061 | - Info(slide, 0x401, ((char *)slide, "cannot process argv\n")); |
3062 | - retcode = PK_MEM; |
3063 | - goto cleanup_and_exit; |
3064 | - } |
3065 | -#endif |
3066 | - |
3067 | -/*--------------------------------------------------------------------------- |
3068 | - Sanity checks. Commentary by Otis B. Driftwood and Fiorello: |
3069 | - |
3070 | - D: It's all right. That's in every contract. That's what they |
3071 | - call a sanity clause. |
3072 | - |
3073 | - F: Ha-ha-ha-ha-ha. You can't fool me. There ain't no Sanity |
3074 | - Claus. |
3075 | - ---------------------------------------------------------------------------*/ |
3076 | - |
3077 | -#ifdef DEBUG |
3078 | -# ifdef LARGE_FILE_SUPPORT |
3079 | - /* test if we can support large files - 10/6/04 EG */ |
3080 | - if (sizeof(zoff_t) < 8) { |
3081 | - Info(slide, 0x401, ((char *)slide, "LARGE_FILE_SUPPORT set but not supported\n")); |
3082 | - retcode = PK_BADERR; |
3083 | - goto cleanup_and_exit; |
3084 | - } |
3085 | - /* test if we can show 64-bit values */ |
3086 | - { |
3087 | - zoff_t z = ~(zoff_t)0; /* z should be all 1s now */ |
3088 | - char *sz; |
3089 | - |
3090 | - sz = FmZofft(z, FZOFFT_HEX_DOT_WID, "X"); |
3091 | - if ((sz[0] != 'F') || (strlen(sz) != 16)) |
3092 | - { |
3093 | - z = 0; |
3094 | - } |
3095 | - |
3096 | - /* shift z so only MSB is set */ |
3097 | - z <<= 63; |
3098 | - sz = FmZofft(z, FZOFFT_HEX_DOT_WID, "X"); |
3099 | - if ((sz[0] != '8') || (strlen(sz) != 16)) |
3100 | - { |
3101 | - Info(slide, 0x401, ((char *)slide, |
3102 | - "Can't show 64-bit values correctly\n")); |
3103 | - retcode = PK_BADERR; |
3104 | - goto cleanup_and_exit; |
3105 | - } |
3106 | - } |
3107 | -# endif /* LARGE_FILE_SUPPORT */ |
3108 | - |
3109 | - /* 2004-11-30 SMS. |
3110 | - Test the NEXTBYTE macro for proper operation. |
3111 | - */ |
3112 | - { |
3113 | - int test_char; |
3114 | - static uch test_buf[2] = { 'a', 'b' }; |
3115 | - |
3116 | - G.inptr = test_buf; |
3117 | - G.incnt = 1; |
3118 | - |
3119 | - test_char = NEXTBYTE; /* Should get 'a'. */ |
3120 | - if (test_char == 'a') |
3121 | - { |
3122 | - test_char = NEXTBYTE; /* Should get EOF, not 'b'. */ |
3123 | - } |
3124 | - if (test_char != EOF) |
3125 | - { |
3126 | - Info(slide, 0x401, ((char *)slide, |
3127 | - "NEXTBYTE macro failed. Try compiling with ALT_NEXTBYTE defined?")); |
3128 | - |
3129 | - retcode = PK_BADERR; |
3130 | - goto cleanup_and_exit; |
3131 | - } |
3132 | - } |
3133 | -#endif /* DEBUG */ |
3134 | - |
3135 | -/*--------------------------------------------------------------------------- |
3136 | - First figure out if we're running in UnZip mode or ZipInfo mode, and put |
3137 | - the appropriate environment-variable options into the queue. Then rip |
3138 | - through any command-line options lurking about... |
3139 | - ---------------------------------------------------------------------------*/ |
3140 | - |
3141 | -#ifdef SFX |
3142 | - G.argv0 = argv[0]; |
3143 | -#if (defined(OS2) || defined(WIN32)) |
3144 | - G.zipfn = GetLoadPath(__G);/* non-MSC NT puts path into G.filename[] */ |
3145 | -#else |
3146 | - G.zipfn = G.argv0; |
3147 | -#endif |
3148 | - |
3149 | -#ifdef VMSCLI |
3150 | - { |
3151 | - ulg status = vms_unzip_cmdline(&argc, &argv); |
3152 | - if (!(status & 1)) { |
3153 | - retcode = (int)status; |
3154 | - goto cleanup_and_exit; |
3155 | - } |
3156 | - } |
3157 | -#endif /* VMSCLI */ |
3158 | - |
3159 | - uO.zipinfo_mode = FALSE; |
3160 | - error = uz_opts(__G__ &argc, &argv); /* UnZipSFX call only */ |
3161 | - |
3162 | -#else /* !SFX */ |
3163 | - |
3164 | -#ifdef RISCOS |
3165 | - /* get the extensions to swap from environment */ |
3166 | - getRISCOSexts(ENV_UNZIPEXTS); |
3167 | -#endif |
3168 | - |
3169 | -#ifdef MSDOS |
3170 | - /* extract MKS extended argument list from environment (before envargs!) */ |
3171 | - mksargs(&argc, &argv); |
3172 | -#endif |
3173 | - |
3174 | -#ifdef VMSCLI |
3175 | - { |
3176 | - ulg status = vms_unzip_cmdline(&argc, &argv); |
3177 | - if (!(status & 1)) { |
3178 | - retcode = (int)status; |
3179 | - goto cleanup_and_exit; |
3180 | - } |
3181 | - } |
3182 | -#endif /* VMSCLI */ |
3183 | - |
3184 | - G.noargs = (argc == 1); /* no options, no zipfile, no anything */ |
3185 | - |
3186 | -#ifndef NO_ZIPINFO |
3187 | - for (p = argv[0] + strlen(argv[0]); p >= argv[0]; --p) { |
3188 | - if (*p == DIR_END |
3189 | -#ifdef DIR_END2 |
3190 | - || *p == DIR_END2 |
3191 | -#endif |
3192 | - ) |
3193 | - break; |
3194 | - } |
3195 | - ++p; |
3196 | - |
3197 | -#ifdef THEOS |
3198 | - if (strncmp(p, "ZIPINFO.",8) == 0 || strstr(p, ".ZIPINFO:") != NULL || |
3199 | - strncmp(p, "II.",3) == 0 || strstr(p, ".II:") != NULL || |
3200 | -#else |
3201 | - if (STRNICMP(p, LoadFarStringSmall(Zipnfo), 7) == 0 || |
3202 | - STRNICMP(p, "ii", 2) == 0 || |
3203 | -#endif |
3204 | - (argc > 1 && strncmp(argv[1], "-Z", 2) == 0)) |
3205 | - { |
3206 | - uO.zipinfo_mode = TRUE; |
3207 | -#ifndef _WIN32_WCE /* Win CE does not support environment variables */ |
3208 | - if ((error = envargs(&argc, &argv, LoadFarStringSmall(EnvZipInfo), |
3209 | - LoadFarStringSmall2(EnvZipInfo2))) != PK_OK) |
3210 | - perror(LoadFarString(NoMemEnvArguments)); |
3211 | -#endif |
3212 | - } else |
3213 | -#endif /* !NO_ZIPINFO */ |
3214 | - { |
3215 | - uO.zipinfo_mode = FALSE; |
3216 | -#ifndef _WIN32_WCE /* Win CE does not support environment variables */ |
3217 | - if ((error = envargs(&argc, &argv, LoadFarStringSmall(EnvUnZip), |
3218 | - LoadFarStringSmall2(EnvUnZip2))) != PK_OK) |
3219 | - perror(LoadFarString(NoMemEnvArguments)); |
3220 | -#endif |
3221 | - } |
3222 | - |
3223 | - if (!error) { |
3224 | - /* Check the length of all passed command line parameters. |
3225 | - * Command arguments might get sent through the Info() message |
3226 | - * system, which uses the sliding window area as string buffer. |
3227 | - * As arguments may additionally get fed through one of the FnFilter |
3228 | - * macros, we require all command line arguments to be shorter than |
3229 | - * WSIZE/4 (and ca. 2 standard line widths for fixed message text). |
3230 | - */ |
3231 | - for (i = 1 ; i < argc; i++) { |
3232 | - if (strlen(argv[i]) > ((WSIZE>>2) - 160)) { |
3233 | - Info(slide, 0x401, ((char *)slide, |
3234 | - LoadFarString(CmdLineParamTooLong), i)); |
3235 | - retcode = PK_PARAM; |
3236 | - goto cleanup_and_exit; |
3237 | - } |
3238 | - } |
3239 | -#ifndef NO_ZIPINFO |
3240 | - if (uO.zipinfo_mode) |
3241 | - error = zi_opts(__G__ &argc, &argv); |
3242 | - else |
3243 | -#endif /* !NO_ZIPINFO */ |
3244 | - error = uz_opts(__G__ &argc, &argv); |
3245 | - } |
3246 | - |
3247 | -#endif /* ?SFX */ |
3248 | - |
3249 | - if ((argc < 0) || error) { |
3250 | - retcode = error; |
3251 | - goto cleanup_and_exit; |
3252 | - } |
3253 | - |
3254 | -/*--------------------------------------------------------------------------- |
3255 | - Now get the zipfile name from the command line and then process any re- |
3256 | - maining options and file specifications. |
3257 | - ---------------------------------------------------------------------------*/ |
3258 | - |
3259 | -#ifdef DOS_FLX_H68_NLM_OS2_W32 |
3260 | - /* convert MSDOS-style 'backward slash' directory separators to Unix-style |
3261 | - * 'forward slashes' for user's convenience (include zipfile name itself) |
3262 | - */ |
3263 | -#ifdef SFX |
3264 | - for (G.pfnames = argv, i = argc; i > 0; --i) { |
3265 | -#else |
3266 | - /* argc does not include the zipfile specification */ |
3267 | - for (G.pfnames = argv, i = argc+1; i > 0; --i) { |
3268 | -#endif |
3269 | -#ifdef __human68k__ |
3270 | - extern char *_toslash(char *); |
3271 | - _toslash(*G.pfnames); |
3272 | -#else /* !__human68k__ */ |
3273 | - char *q = *G.pfnames; |
3274 | - |
3275 | - while (*q != '\0') { |
3276 | - if (*q == '\\') |
3277 | - *q = '/'; |
3278 | - INCSTR(q); |
3279 | - } |
3280 | -#endif /* ?__human68k__ */ |
3281 | - ++G.pfnames; |
3282 | - } |
3283 | -#endif /* DOS_FLX_H68_NLM_OS2_W32 */ |
3284 | - |
3285 | -#ifndef SFX |
3286 | - G.wildzipfn = *argv++; |
3287 | -#endif |
3288 | - |
3289 | -#if (defined(SFX) && !defined(SFX_EXDIR)) /* only check for -x */ |
3290 | - |
3291 | - G.filespecs = argc; |
3292 | - G.xfilespecs = 0; |
3293 | - |
3294 | - if (argc > 0) { |
3295 | - char **pp = argv-1; |
3296 | - |
3297 | - G.pfnames = argv; |
3298 | - while (*++pp) |
3299 | - if (strcmp(*pp, "-x") == 0) { |
3300 | - if (pp > argv) { |
3301 | - *pp = 0; /* terminate G.pfnames */ |
3302 | - G.filespecs = pp - G.pfnames; |
3303 | - } else { |
3304 | - G.pfnames = (char **)fnames; /* defaults */ |
3305 | - G.filespecs = 0; |
3306 | - } |
3307 | - G.pxnames = pp + 1; /* excluded-names ptr: _after_ -x */ |
3308 | - G.xfilespecs = argc - G.filespecs - 1; |
3309 | - break; /* skip rest of args */ |
3310 | - } |
3311 | - G.process_all_files = FALSE; |
3312 | - } else |
3313 | - G.process_all_files = TRUE; /* for speed */ |
3314 | - |
3315 | -#else /* !SFX || SFX_EXDIR */ /* check for -x or -d */ |
3316 | - |
3317 | - G.filespecs = argc; |
3318 | - G.xfilespecs = 0; |
3319 | - |
3320 | - if (argc > 0) { |
3321 | - int in_files=FALSE, in_xfiles=FALSE; |
3322 | - char **pp = argv-1; |
3323 | - |
3324 | - G.process_all_files = FALSE; |
3325 | - G.pfnames = argv; |
3326 | - while (*++pp) { |
3327 | - Trace((stderr, "pp - argv = %d\n", pp-argv)); |
3328 | -#ifdef CMS_MVS |
3329 | - if (!uO.exdir && STRNICMP(*pp, "-d", 2) == 0) { |
3330 | -#else |
3331 | - if (!uO.exdir && strncmp(*pp, "-d", 2) == 0) { |
3332 | -#endif |
3333 | - int firstarg = (pp == argv); |
3334 | - |
3335 | - uO.exdir = (*pp) + 2; |
3336 | - if (in_files) { /* ... zipfile ... -d exdir ... */ |
3337 | - *pp = (char *)NULL; /* terminate G.pfnames */ |
3338 | - G.filespecs = pp - G.pfnames; |
3339 | - in_files = FALSE; |
3340 | - } else if (in_xfiles) { |
3341 | - *pp = (char *)NULL; /* terminate G.pxnames */ |
3342 | - G.xfilespecs = pp - G.pxnames; |
3343 | - /* "... -x xlist -d exdir": nothing left */ |
3344 | - } |
3345 | - /* first check for "-dexdir", then for "-d exdir" */ |
3346 | - if (*uO.exdir == '\0') { |
3347 | - if (*++pp) |
3348 | - uO.exdir = *pp; |
3349 | - else { |
3350 | - Info(slide, 0x401, ((char *)slide, |
3351 | - LoadFarString(MustGiveExdir))); |
3352 | - /* don't extract here by accident */ |
3353 | - retcode = PK_PARAM; |
3354 | - goto cleanup_and_exit; |
3355 | - } |
3356 | - } |
3357 | - if (firstarg) { /* ... zipfile -d exdir ... */ |
3358 | - if (pp[1]) { |
3359 | - G.pfnames = pp + 1; /* argv+2 */ |
3360 | - G.filespecs = argc - (G.pfnames-argv); /* for now... */ |
3361 | - } else { |
3362 | - G.process_all_files = TRUE; |
3363 | - G.pfnames = (char **)fnames; /* GRR: necessary? */ |
3364 | - G.filespecs = 0; /* GRR: necessary? */ |
3365 | - break; |
3366 | - } |
3367 | - } |
3368 | - } else if (!in_xfiles) { |
3369 | - if (strcmp(*pp, "-x") == 0) { |
3370 | - in_xfiles = TRUE; |
3371 | - if (pp == G.pfnames) { |
3372 | - G.pfnames = (char **)fnames; /* defaults */ |
3373 | - G.filespecs = 0; |
3374 | - } else if (in_files) { |
3375 | - *pp = 0; /* terminate G.pfnames */ |
3376 | - G.filespecs = pp - G.pfnames; /* adjust count */ |
3377 | - in_files = FALSE; |
3378 | - } |
3379 | - G.pxnames = pp + 1; /* excluded-names ptr starts after -x */ |
3380 | - G.xfilespecs = argc - (G.pxnames-argv); /* anything left */ |
3381 | - } else |
3382 | - in_files = TRUE; |
3383 | - } |
3384 | - } |
3385 | - } else |
3386 | - G.process_all_files = TRUE; /* for speed */ |
3387 | - |
3388 | - if (uO.exdir != (char *)NULL && !G.extract_flag) /* -d ignored */ |
3389 | - Info(slide, 0x401, ((char *)slide, LoadFarString(NotExtracting))); |
3390 | -#endif /* ?(SFX && !SFX_EXDIR) */ |
3391 | - |
3392 | -#ifdef UNICODE_SUPPORT |
3393 | - /* set Unicode-escape-all if option -U used */ |
3394 | - if (uO.U_flag == 1) |
3395 | -# ifdef UNICODE_WCHAR |
3396 | - G.unicode_escape_all = TRUE; |
3397 | -# else |
3398 | - Info(slide, 0x401, ((char *)slide, LoadFarString(UTF8EscapeUnSupp))); |
3399 | -# endif |
3400 | -#endif |
3401 | - |
3402 | - |
3403 | -/*--------------------------------------------------------------------------- |
3404 | - Okey dokey, we have everything we need to get started. Let's roll. |
3405 | - ---------------------------------------------------------------------------*/ |
3406 | - |
3407 | - retcode = process_zipfiles(__G); |
3408 | - |
3409 | -cleanup_and_exit: |
3410 | -#if (defined(REENTRANT) && !defined(NO_EXCEPT_SIGNALS)) |
3411 | - /* restore all signal handlers back to their state at function entry */ |
3412 | - while (oldsighandlers != NULL) { |
3413 | - savsigs_info *thissigsav = oldsighandlers; |
3414 | - |
3415 | - signal(thissigsav->sigtype, thissigsav->sighandler); |
3416 | - oldsighandlers = thissigsav->previous; |
3417 | - free(thissigsav); |
3418 | - } |
3419 | -#endif |
3420 | -#if (defined(MALLOC_WORK) && !defined(REENTRANT)) |
3421 | - if (G.area.Slide != (uch *)NULL) { |
3422 | - free(G.area.Slide); |
3423 | - G.area.Slide = (uch *)NULL; |
3424 | - } |
3425 | -#endif |
3426 | -#if (defined(MSDOS) && !defined(SFX) && !defined(WINDLL)) |
3427 | - if (retcode != PK_OK) |
3428 | - check_for_windows("UnZip"); |
3429 | -#endif |
3430 | - return(retcode); |
3431 | - |
3432 | -} /* end main()/unzip() */ |
3433 | - |
3434 | - |
3435 | - |
3436 | - |
3437 | - |
3438 | -#if (defined(REENTRANT) && !defined(NO_EXCEPT_SIGNALS)) |
3439 | -/*******************************/ |
3440 | -/* Function setsignalhandler() */ |
3441 | -/*******************************/ |
3442 | - |
3443 | -static int setsignalhandler(__G__ p_savedhandler_chain, signal_type, |
3444 | - newhandler) |
3445 | - __GDEF |
3446 | - savsigs_info **p_savedhandler_chain; |
3447 | - int signal_type; |
3448 | - void (*newhandler)(int); |
3449 | -{ |
3450 | - savsigs_info *savsig; |
3451 | - |
3452 | - savsig = malloc(sizeof(savsigs_info)); |
3453 | - if (savsig == NULL) { |
3454 | - /* error message and break */ |
3455 | - Info(slide, 0x401, ((char *)slide, LoadFarString(CantSaveSigHandler))); |
3456 | - return PK_MEM; |
3457 | - } |
3458 | - savsig->sigtype = signal_type; |
3459 | - savsig->sighandler = signal(SIGINT, newhandler); |
3460 | - if (savsig->sighandler == SIG_ERR) { |
3461 | - free(savsig); |
3462 | - } else { |
3463 | - savsig->previous = *p_savedhandler_chain; |
3464 | - *p_savedhandler_chain = savsig; |
3465 | - } |
3466 | - return PK_OK; |
3467 | - |
3468 | -} /* end function setsignalhandler() */ |
3469 | - |
3470 | -#endif /* REENTRANT && !NO_EXCEPT_SIGNALS */ |
3471 | - |
3472 | - |
3473 | - |
3474 | - |
3475 | - |
3476 | -/**********************/ |
3477 | -/* Function uz_opts() */ |
3478 | -/**********************/ |
3479 | - |
3480 | -int uz_opts(__G__ pargc, pargv) |
3481 | - __GDEF |
3482 | - int *pargc; |
3483 | - char ***pargv; |
3484 | -{ |
3485 | - char **argv, *s; |
3486 | - int argc, c, error=FALSE, negative=0, showhelp=0; |
3487 | - |
3488 | - |
3489 | - argc = *pargc; |
3490 | - argv = *pargv; |
3491 | - |
3492 | - while (++argv, (--argc > 0 && *argv != NULL && **argv == '-')) { |
3493 | - s = *argv + 1; |
3494 | - while ((c = *s++) != 0) { /* "!= 0": prevent Turbo C warning */ |
3495 | -#ifdef CMS_MVS |
3496 | - switch (tolower(c)) |
3497 | -#else |
3498 | - switch (c) |
3499 | -#endif |
3500 | - { |
3501 | - case ('-'): |
3502 | - ++negative; |
3503 | - break; |
3504 | -#ifdef RISCOS |
3505 | - case ('/'): |
3506 | - if (negative) { /* negative not allowed with -/ swap */ |
3507 | - Info(slide, 0x401, ((char *)slide, |
3508 | - "error: must give extensions list")); |
3509 | - return(PK_PARAM); /* don't extract here by accident */ |
3510 | - } |
3511 | - exts2swap = s; /* override Unzip$Exts */ |
3512 | - s += strlen(s); |
3513 | - break; |
3514 | -#endif |
3515 | - case ('a'): |
3516 | - if (negative) { |
3517 | - uO.aflag = MAX(uO.aflag-negative,0); |
3518 | - negative = 0; |
3519 | - } else |
3520 | - ++uO.aflag; |
3521 | - break; |
3522 | -#if (defined(DLL) && defined(API_DOC)) |
3523 | - case ('A'): /* extended help for API */ |
3524 | - APIhelp(__G__ argc, argv); |
3525 | - *pargc = -1; /* signal to exit successfully */ |
3526 | - return 0; |
3527 | -#endif |
3528 | - case ('b'): |
3529 | - if (negative) { |
3530 | -#if (defined(TANDEM) || defined(VMS)) |
3531 | - uO.bflag = MAX(uO.bflag-negative,0); |
3532 | -#endif |
3533 | - negative = 0; /* do nothing: "-b" is default */ |
3534 | - } else { |
3535 | -#ifdef VMS |
3536 | - if (uO.aflag == 0) |
3537 | - ++uO.bflag; |
3538 | -#endif |
3539 | -#ifdef TANDEM |
3540 | - ++uO.bflag; |
3541 | -#endif |
3542 | - uO.aflag = 0; |
3543 | - } |
3544 | - break; |
3545 | -#ifdef UNIXBACKUP |
3546 | - case ('B'): /* -B: back up existing files */ |
3547 | - if (negative) |
3548 | - uO.B_flag = FALSE, negative = 0; |
3549 | - else |
3550 | - uO.B_flag = TRUE; |
3551 | - break; |
3552 | -#endif |
3553 | - case ('c'): |
3554 | - if (negative) { |
3555 | - uO.cflag = FALSE, negative = 0; |
3556 | -#ifdef NATIVE |
3557 | - uO.aflag = 0; |
3558 | -#endif |
3559 | - } else { |
3560 | - uO.cflag = TRUE; |
3561 | -#ifdef NATIVE |
3562 | - uO.aflag = 2; /* so you can read it on the screen */ |
3563 | -#endif |
3564 | -#ifdef DLL |
3565 | - if (G.redirect_text) |
3566 | - G.redirect_data = 2; |
3567 | -#endif |
3568 | - } |
3569 | - break; |
3570 | -#ifndef CMS_MVS |
3571 | - case ('C'): /* -C: match filenames case-insensitively */ |
3572 | - if (negative) |
3573 | - uO.C_flag = FALSE, negative = 0; |
3574 | - else |
3575 | - uO.C_flag = TRUE; |
3576 | - break; |
3577 | -#endif /* !CMS_MVS */ |
3578 | -#if (!defined(SFX) || defined(SFX_EXDIR)) |
3579 | - case ('d'): |
3580 | - if (negative) { /* negative not allowed with -d exdir */ |
3581 | - Info(slide, 0x401, ((char *)slide, |
3582 | - LoadFarString(MustGiveExdir))); |
3583 | - return(PK_PARAM); /* don't extract here by accident */ |
3584 | - } |
3585 | - if (uO.exdir != (char *)NULL) { |
3586 | - Info(slide, 0x401, ((char *)slide, |
3587 | - LoadFarString(OnlyOneExdir))); |
3588 | - return(PK_PARAM); /* GRR: stupid restriction? */ |
3589 | - } else { |
3590 | - /* first check for "-dexdir", then for "-d exdir" */ |
3591 | - uO.exdir = s; |
3592 | - if (*uO.exdir == '\0') { |
3593 | - if (argc > 1) { |
3594 | - --argc; |
3595 | - uO.exdir = *++argv; |
3596 | - if (*uO.exdir == '-') { |
3597 | - Info(slide, 0x401, ((char *)slide, |
3598 | - LoadFarString(MustGiveExdir))); |
3599 | - return(PK_PARAM); |
3600 | - } |
3601 | - /* else uO.exdir points at extraction dir */ |
3602 | - } else { |
3603 | - Info(slide, 0x401, ((char *)slide, |
3604 | - LoadFarString(MustGiveExdir))); |
3605 | - return(PK_PARAM); |
3606 | - } |
3607 | - } |
3608 | - /* uO.exdir now points at extraction dir (-dexdir or |
3609 | - * -d exdir); point s at end of exdir to avoid mis- |
3610 | - * interpretation of exdir characters as more options |
3611 | - */ |
3612 | - if (*s != 0) |
3613 | - while (*++s != 0) |
3614 | - ; |
3615 | - } |
3616 | - break; |
3617 | -#endif /* !SFX || SFX_EXDIR */ |
3618 | -#if (!defined(NO_TIMESTAMPS)) |
3619 | - case ('D'): /* -D: Skip restoring dir (or any) timestamp. */ |
3620 | - if (negative) { |
3621 | - uO.D_flag = MAX(uO.D_flag-negative,0); |
3622 | - negative = 0; |
3623 | - } else |
3624 | - uO.D_flag++; |
3625 | - break; |
3626 | -#endif /* (!NO_TIMESTAMPS) */ |
3627 | - case ('e'): /* just ignore -e, -x options (extract) */ |
3628 | - break; |
3629 | -#ifdef MACOS |
3630 | - case ('E'): /* -E [MacOS] display Mac e.f. when restoring */ |
3631 | - if( negative ) { |
3632 | - uO.E_flag = FALSE, negative = 0; |
3633 | - } else { |
3634 | - uO.E_flag = TRUE; |
3635 | - } |
3636 | - break; |
3637 | -#endif /* MACOS */ |
3638 | - case ('f'): /* "freshen" (extract only newer files) */ |
3639 | - if (negative) |
3640 | - uO.fflag = uO.uflag = FALSE, negative = 0; |
3641 | - else |
3642 | - uO.fflag = uO.uflag = TRUE; |
3643 | - break; |
3644 | -#if (defined(RISCOS) || defined(ACORN_FTYPE_NFS)) |
3645 | - case ('F'): /* Acorn filetype & NFS extension handling */ |
3646 | - if (negative) |
3647 | - uO.acorn_nfs_ext = FALSE, negative = 0; |
3648 | - else |
3649 | - uO.acorn_nfs_ext = TRUE; |
3650 | - break; |
3651 | -#endif /* RISCOS || ACORN_FTYPE_NFS */ |
3652 | - case ('h'): /* just print help message and quit */ |
3653 | - if (showhelp == 0) { |
3654 | -#ifndef SFX |
3655 | - if (*s == 'h') |
3656 | - showhelp = 2; |
3657 | - else |
3658 | -#endif /* !SFX */ |
3659 | - { |
3660 | - showhelp = 1; |
3661 | - } |
3662 | - } |
3663 | - break; |
3664 | -#ifdef MACOS |
3665 | - case ('i'): /* -i [MacOS] ignore filenames stored in Mac ef */ |
3666 | - if( negative ) { |
3667 | - uO.i_flag = FALSE, negative = 0; |
3668 | - } else { |
3669 | - uO.i_flag = TRUE; |
3670 | - } |
3671 | - break; |
3672 | -#endif /* MACOS */ |
3673 | - case ('j'): /* junk pathnames/directory structure */ |
3674 | - if (negative) |
3675 | - uO.jflag = FALSE, negative = 0; |
3676 | - else |
3677 | - uO.jflag = TRUE; |
3678 | - break; |
3679 | -#if (defined(ATH_BEO) || defined(MACOS)) |
3680 | - case ('J'): /* Junk AtheOS, BeOS or MacOS file attributes */ |
3681 | - if( negative ) { |
3682 | - uO.J_flag = FALSE, negative = 0; |
3683 | - } else { |
3684 | - uO.J_flag = TRUE; |
3685 | - } |
3686 | - break; |
3687 | -#endif /* ATH_BEO || MACOS */ |
3688 | -#ifdef ATH_BEO_UNX |
3689 | - case ('K'): |
3690 | - if (negative) { |
3691 | - uO.K_flag = FALSE, negative = 0; |
3692 | - } else { |
3693 | - uO.K_flag = TRUE; |
3694 | - } |
3695 | - break; |
3696 | -#endif /* ATH_BEO_UNX */ |
3697 | -#ifndef SFX |
3698 | - case ('l'): |
3699 | - if (negative) { |
3700 | - uO.vflag = MAX(uO.vflag-negative,0); |
3701 | - negative = 0; |
3702 | - } else |
3703 | - ++uO.vflag; |
3704 | - break; |
3705 | -#endif /* !SFX */ |
3706 | -#ifndef CMS_MVS |
3707 | - case ('L'): /* convert (some) filenames to lowercase */ |
3708 | - if (negative) { |
3709 | - uO.L_flag = MAX(uO.L_flag-negative,0); |
3710 | - negative = 0; |
3711 | - } else |
3712 | - ++uO.L_flag; |
3713 | - break; |
3714 | -#endif /* !CMS_MVS */ |
3715 | -#ifdef MORE |
3716 | -#ifdef CMS_MVS |
3717 | - case ('m'): |
3718 | -#endif |
3719 | - case ('M'): /* send all screen output through "more" fn. */ |
3720 | -/* GRR: eventually check for numerical argument => height */ |
3721 | - if (negative) |
3722 | - G.M_flag = FALSE, negative = 0; |
3723 | - else |
3724 | - G.M_flag = TRUE; |
3725 | - break; |
3726 | -#endif /* MORE */ |
3727 | - case ('n'): /* don't overwrite any files */ |
3728 | - if (negative) |
3729 | - uO.overwrite_none = FALSE, negative = 0; |
3730 | - else |
3731 | - uO.overwrite_none = TRUE; |
3732 | - break; |
3733 | -#ifdef AMIGA |
3734 | - case ('N'): /* restore comments as filenotes */ |
3735 | - if (negative) |
3736 | - uO.N_flag = FALSE, negative = 0; |
3737 | - else |
3738 | - uO.N_flag = TRUE; |
3739 | - break; |
3740 | -#endif /* AMIGA */ |
3741 | - case ('o'): /* OK to overwrite files without prompting */ |
3742 | - if (negative) { |
3743 | - uO.overwrite_all = MAX(uO.overwrite_all-negative,0); |
3744 | - negative = 0; |
3745 | - } else |
3746 | - ++uO.overwrite_all; |
3747 | - break; |
3748 | - case ('p'): /* pipes: extract to stdout, no messages */ |
3749 | - if (negative) { |
3750 | - uO.cflag = FALSE; |
3751 | - uO.qflag = MAX(uO.qflag-999,0); |
3752 | - negative = 0; |
3753 | - } else { |
3754 | - uO.cflag = TRUE; |
3755 | - uO.qflag += 999; |
3756 | - } |
3757 | - break; |
3758 | -#if CRYPT |
3759 | - /* GRR: yes, this is highly insecure, but dozens of people |
3760 | - * have pestered us for this, so here we go... */ |
3761 | - case ('P'): |
3762 | - if (negative) { /* negative not allowed with -P passwd */ |
3763 | - Info(slide, 0x401, ((char *)slide, |
3764 | - LoadFarString(MustGivePasswd))); |
3765 | - return(PK_PARAM); /* don't extract here by accident */ |
3766 | - } |
3767 | - if (uO.pwdarg != (char *)NULL) { |
3768 | -/* |
3769 | - GRR: eventually support multiple passwords? |
3770 | - Info(slide, 0x401, ((char *)slide, |
3771 | - LoadFarString(OnlyOnePasswd))); |
3772 | - return(PK_PARAM); |
3773 | - */ |
3774 | - } else { |
3775 | - /* first check for "-Ppasswd", then for "-P passwd" */ |
3776 | - uO.pwdarg = s; |
3777 | - if (*uO.pwdarg == '\0') { |
3778 | - if (argc > 1) { |
3779 | - --argc; |
3780 | - uO.pwdarg = *++argv; |
3781 | - if (*uO.pwdarg == '-') { |
3782 | - Info(slide, 0x401, ((char *)slide, |
3783 | - LoadFarString(MustGivePasswd))); |
3784 | - return(PK_PARAM); |
3785 | - } |
3786 | - /* else pwdarg points at decryption password */ |
3787 | - } else { |
3788 | - Info(slide, 0x401, ((char *)slide, |
3789 | - LoadFarString(MustGivePasswd))); |
3790 | - return(PK_PARAM); |
3791 | - } |
3792 | - } |
3793 | - /* pwdarg now points at decryption password (-Ppasswd or |
3794 | - * -P passwd); point s at end of passwd to avoid mis- |
3795 | - * interpretation of passwd characters as more options |
3796 | - */ |
3797 | - if (*s != 0) |
3798 | - while (*++s != 0) |
3799 | - ; |
3800 | - } |
3801 | - break; |
3802 | -#endif /* CRYPT */ |
3803 | - case ('q'): /* quiet: fewer comments/messages */ |
3804 | - if (negative) { |
3805 | - uO.qflag = MAX(uO.qflag-negative,0); |
3806 | - negative = 0; |
3807 | - } else |
3808 | - ++uO.qflag; |
3809 | - break; |
3810 | -#ifdef QDOS |
3811 | - case ('Q'): /* QDOS flags */ |
3812 | - qlflag ^= strtol(s, &s, 10); |
3813 | - break; /* we XOR this as we can config qlflags */ |
3814 | -#endif |
3815 | -#ifdef TANDEM |
3816 | - case ('r'): /* remove file extensions */ |
3817 | - if (negative) |
3818 | - uO.rflag = FALSE, negative = 0; |
3819 | - else |
3820 | - uO.rflag = TRUE; |
3821 | - break; |
3822 | -#endif /* TANDEM */ |
3823 | -#ifdef DOS_FLX_NLM_OS2_W32 |
3824 | - case ('s'): /* spaces in filenames: allow by default */ |
3825 | - if (negative) |
3826 | - uO.sflag = FALSE, negative = 0; |
3827 | - else |
3828 | - uO.sflag = TRUE; |
3829 | - break; |
3830 | -#endif /* DOS_FLX_NLM_OS2_W32 */ |
3831 | -#ifdef VMS |
3832 | - /* VMS: extract "text" files in Stream_LF format (-a[a]) */ |
3833 | - case ('S'): |
3834 | - if (negative) |
3835 | - uO.S_flag = FALSE, negative = 0; |
3836 | - else |
3837 | - uO.S_flag = TRUE; |
3838 | - break; |
3839 | -#endif /* VMS */ |
3840 | - case ('t'): |
3841 | - if (negative) |
3842 | - uO.tflag = FALSE, negative = 0; |
3843 | - else |
3844 | - uO.tflag = TRUE; |
3845 | - break; |
3846 | -#ifdef TIMESTAMP |
3847 | - case ('T'): |
3848 | - if (negative) |
3849 | - uO.T_flag = FALSE, negative = 0; |
3850 | - else |
3851 | - uO.T_flag = TRUE; |
3852 | - break; |
3853 | -#endif |
3854 | - case ('u'): /* update (extract only new and newer files) */ |
3855 | - if (negative) |
3856 | - uO.uflag = FALSE, negative = 0; |
3857 | - else |
3858 | - uO.uflag = TRUE; |
3859 | - break; |
3860 | -#ifdef UNICODE_SUPPORT |
3861 | - case ('U'): /* escape UTF-8, or disable UTF-8 support */ |
3862 | - if (negative) { |
3863 | - uO.U_flag = MAX(uO.U_flag-negative,0); |
3864 | - negative = 0; |
3865 | - } else |
3866 | - uO.U_flag++; |
3867 | - break; |
3868 | -#else /* !UNICODE_SUPPORT */ |
3869 | -#ifndef CMS_MVS |
3870 | - case ('U'): /* obsolete; to be removed in version 6.0 */ |
3871 | - if (negative) |
3872 | - uO.L_flag = TRUE, negative = 0; |
3873 | - else |
3874 | - uO.L_flag = FALSE; |
3875 | - break; |
3876 | -#endif /* !CMS_MVS */ |
3877 | -#endif /* ?UNICODE_SUPPORT */ |
3878 | -#ifndef SFX |
3879 | - case ('v'): /* verbose */ |
3880 | - if (negative) { |
3881 | - uO.vflag = MAX(uO.vflag-negative,0); |
3882 | - negative = 0; |
3883 | - } else if (uO.vflag) |
3884 | - ++uO.vflag; |
3885 | - else |
3886 | - uO.vflag = 2; |
3887 | - break; |
3888 | -#endif /* !SFX */ |
3889 | -#ifndef CMS_MVS |
3890 | - case ('V'): /* Version (retain VMS/DEC-20 file versions) */ |
3891 | - if (negative) |
3892 | - uO.V_flag = FALSE, negative = 0; |
3893 | - else |
3894 | - uO.V_flag = TRUE; |
3895 | - break; |
3896 | -#endif /* !CMS_MVS */ |
3897 | -#ifdef WILD_STOP_AT_DIR |
3898 | - case ('W'): /* Wildcard interpretation (stop at '/'?) */ |
3899 | - if (negative) |
3900 | - uO.W_flag = FALSE, negative = 0; |
3901 | - else |
3902 | - uO.W_flag = TRUE; |
3903 | - break; |
3904 | -#endif /* WILD_STOP_AT_DIR */ |
3905 | - case ('x'): /* extract: default */ |
3906 | -#ifdef SFX |
3907 | - /* when 'x' is the only option in this argument, and the |
3908 | - * next arg is not an option, assume this initiates an |
3909 | - * exclusion list (-x xlist): terminate option-scanning |
3910 | - * and leave uz_opts with argv still pointing to "-x"; |
3911 | - * the xlist is processed later |
3912 | - */ |
3913 | - if (s - argv[0] == 2 && *s == '\0' && |
3914 | - argc > 1 && argv[1][0] != '-') { |
3915 | - /* break out of nested loops without "++argv;--argc" */ |
3916 | - goto opts_done; |
3917 | - } |
3918 | -#endif /* SFX */ |
3919 | - break; |
3920 | -#if (defined(RESTORE_UIDGID) || defined(RESTORE_ACL)) |
3921 | - case ('X'): /* restore owner/protection info (need privs?) */ |
3922 | - if (negative) { |
3923 | - uO.X_flag = MAX(uO.X_flag-negative,0); |
3924 | - negative = 0; |
3925 | - } else |
3926 | - ++uO.X_flag; |
3927 | - break; |
3928 | -#endif /* RESTORE_UIDGID || RESTORE_ACL */ |
3929 | -#ifdef VMS |
3930 | - case ('Y'): /* Treat ".nnn" as ";nnn" version. */ |
3931 | - if (negative) |
3932 | - uO.Y_flag = FALSE, negative = 0; |
3933 | - else |
3934 | - uO.Y_flag = TRUE; |
3935 | - break; |
3936 | -#endif /* VMS */ |
3937 | - case ('z'): /* display only the archive comment */ |
3938 | - if (negative) { |
3939 | - uO.zflag = MAX(uO.zflag-negative,0); |
3940 | - negative = 0; |
3941 | - } else |
3942 | - ++uO.zflag; |
3943 | - break; |
3944 | -#ifndef SFX |
3945 | - case ('Z'): /* should have been first option (ZipInfo) */ |
3946 | - Info(slide, 0x401, ((char *)slide, LoadFarString(Zfirst))); |
3947 | - error = TRUE; |
3948 | - break; |
3949 | -#endif /* !SFX */ |
3950 | -#ifdef VMS |
3951 | - case ('2'): /* Force ODS2-compliant names. */ |
3952 | - if (negative) |
3953 | - uO.ods2_flag = FALSE, negative = 0; |
3954 | - else |
3955 | - uO.ods2_flag = TRUE; |
3956 | - break; |
3957 | -#endif /* VMS */ |
3958 | -#ifdef DOS_H68_OS2_W32 |
3959 | - case ('$'): |
3960 | - if (negative) { |
3961 | - uO.volflag = MAX(uO.volflag-negative,0); |
3962 | - negative = 0; |
3963 | - } else |
3964 | - ++uO.volflag; |
3965 | - break; |
3966 | -#endif /* DOS_H68_OS2_W32 */ |
3967 | -#if (!defined(RISCOS) && !defined(CMS_MVS) && !defined(TANDEM)) |
3968 | - case (':'): /* allow "parent dir" path components */ |
3969 | - if (negative) { |
3970 | - uO.ddotflag = MAX(uO.ddotflag-negative,0); |
3971 | - negative = 0; |
3972 | - } else |
3973 | - ++uO.ddotflag; |
3974 | - break; |
3975 | -#endif /* !RISCOS && !CMS_MVS && !TANDEM */ |
3976 | -#ifdef UNIX |
3977 | - case ('^'): /* allow control chars in filenames */ |
3978 | - if (negative) { |
3979 | - uO.cflxflag = MAX(uO.cflxflag-negative,0); |
3980 | - negative = 0; |
3981 | - } else |
3982 | - ++uO.cflxflag; |
3983 | - break; |
3984 | -#endif /* UNIX */ |
3985 | - default: |
3986 | - error = TRUE; |
3987 | - break; |
3988 | - |
3989 | - } /* end switch */ |
3990 | - } /* end while (not end of argument string) */ |
3991 | - } /* end while (not done with switches) */ |
3992 | - |
3993 | -/*--------------------------------------------------------------------------- |
3994 | - Check for nonsensical combinations of options. |
3995 | - ---------------------------------------------------------------------------*/ |
3996 | - |
3997 | -#ifdef SFX |
3998 | -opts_done: /* yes, very ugly...but only used by UnZipSFX with -x xlist */ |
3999 | -#endif |
4000 | - |
4001 | - if (showhelp > 0) { /* just print help message and quit */ |
4002 | - *pargc = -1; |
4003 | -#ifndef SFX |
4004 | - if (showhelp == 2) { |
4005 | - help_extended(__G); |
4006 | - return PK_OK; |
4007 | - } else |
4008 | -#endif /* !SFX */ |
4009 | - { |
4010 | - return USAGE(PK_OK); |
4011 | - } |
4012 | - } |
4013 | - |
4014 | - if ((uO.cflag && (uO.tflag || uO.uflag)) || |
4015 | - (uO.tflag && uO.uflag) || (uO.fflag && uO.overwrite_none)) |
4016 | - { |
4017 | - Info(slide, 0x401, ((char *)slide, LoadFarString(InvalidOptionsMsg))); |
4018 | - error = TRUE; |
4019 | - } |
4020 | - if (uO.aflag > 2) |
4021 | - uO.aflag = 2; |
4022 | -#ifdef VMS |
4023 | - if (uO.bflag > 2) |
4024 | - uO.bflag = 2; |
4025 | - /* Clear -s flag when converting text files. */ |
4026 | - if (uO.aflag <= 0) |
4027 | - uO.S_flag = 0; |
4028 | -#endif /* VMS */ |
4029 | - if (uO.overwrite_all && uO.overwrite_none) { |
4030 | - Info(slide, 0x401, ((char *)slide, LoadFarString(IgnoreOOptionMsg))); |
4031 | - uO.overwrite_all = FALSE; |
4032 | - } |
4033 | -#ifdef MORE |
4034 | - if (G.M_flag && !isatty(1)) /* stdout redirected: "more" func. useless */ |
4035 | - G.M_flag = 0; |
4036 | -#endif |
4037 | - |
4038 | -#ifdef SFX |
4039 | - if (error) |
4040 | -#else |
4041 | - if ((argc-- == 0) || error) |
4042 | -#endif |
4043 | - { |
4044 | - *pargc = argc; |
4045 | - *pargv = argv; |
4046 | -#ifndef SFX |
4047 | - if (uO.vflag >= 2 && argc == -1) { /* "unzip -v" */ |
4048 | - show_version_info(__G); |
4049 | - return PK_OK; |
4050 | - } |
4051 | - if (!G.noargs && !error) |
4052 | - error = TRUE; /* had options (not -h or -v) but no zipfile */ |
4053 | -#endif /* !SFX */ |
4054 | - return USAGE(error); |
4055 | - } |
4056 | - |
4057 | -#ifdef SFX |
4058 | - /* print our banner unless we're being fairly quiet */ |
4059 | - if (uO.qflag < 2) |
4060 | - Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(UnzipSFXBanner), |
4061 | - UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL, |
4062 | - LoadFarStringSmall(VersionDate))); |
4063 | -#ifdef BETA |
4064 | - /* always print the beta warning: no unauthorized distribution!! */ |
4065 | - Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(BetaVersion), "\n", |
4066 | - "SFX")); |
4067 | -#endif |
4068 | -#endif /* SFX */ |
4069 | - |
4070 | - if (uO.cflag || uO.tflag || uO.vflag || uO.zflag |
4071 | -#ifdef TIMESTAMP |
4072 | - || uO.T_flag |
4073 | -#endif |
4074 | - ) |
4075 | - G.extract_flag = FALSE; |
4076 | - else |
4077 | - G.extract_flag = TRUE; |
4078 | - |
4079 | - *pargc = argc; |
4080 | - *pargv = argv; |
4081 | - return PK_OK; |
4082 | - |
4083 | -} /* end function uz_opts() */ |
4084 | - |
4085 | - |
4086 | - |
4087 | - |
4088 | -/********************/ |
4089 | -/* Function usage() */ |
4090 | -/********************/ |
4091 | - |
4092 | -#ifdef SFX |
4093 | -# ifdef VMS |
4094 | -# define LOCAL "X.\n\ |
4095 | -(Must quote upper-case options, like \"-V\", unless SET PROC/PARSE=EXTEND.)" |
4096 | -# endif |
4097 | -# ifdef UNIX |
4098 | -# define LOCAL "X" |
4099 | -# endif |
4100 | -# ifdef DOS_OS2_W32 |
4101 | -# define LOCAL "s$" |
4102 | -# endif |
4103 | -# if (defined(FLEXOS) || defined(NLM)) |
4104 | -# define LOCAL "s" |
4105 | -# endif |
4106 | -# ifdef AMIGA |
4107 | -# define LOCAL "N" |
4108 | -# endif |
4109 | - /* Default for all other systems: */ |
4110 | -# ifndef LOCAL |
4111 | -# define LOCAL "" |
4112 | -# endif |
4113 | - |
4114 | -# ifndef NO_TIMESTAMP |
4115 | -# ifdef MORE |
4116 | -# define SFXOPT1 "DM" |
4117 | -# else |
4118 | -# define SFXOPT1 "D" |
4119 | -# endif |
4120 | -# else |
4121 | -# ifdef MORE |
4122 | -# define SFXOPT1 "M" |
4123 | -# else |
4124 | -# define SFXOPT1 "" |
4125 | -# endif |
4126 | -# endif |
4127 | - |
4128 | -int usage(__G__ error) /* return PK-type error code */ |
4129 | - __GDEF |
4130 | - int error; |
4131 | -{ |
4132 | - Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(UnzipSFXBanner), |
4133 | - UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL, |
4134 | - LoadFarStringSmall(VersionDate))); |
4135 | - Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(UnzipSFXOpts), |
4136 | - SFXOPT1, LOCAL)); |
4137 | -#ifdef BETA |
4138 | - Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(BetaVersion), "\n", |
4139 | - "SFX")); |
4140 | -#endif |
4141 | - |
4142 | - if (error) |
4143 | - return PK_PARAM; |
4144 | - else |
4145 | - return PK_COOL; /* just wanted usage screen: no error */ |
4146 | - |
4147 | -} /* end function usage() */ |
4148 | - |
4149 | - |
4150 | - |
4151 | - |
4152 | - |
4153 | -#else /* !SFX */ |
4154 | -# ifdef VMS |
4155 | -# define QUOT '\"' |
4156 | -# define QUOTS "\"" |
4157 | -# else |
4158 | -# define QUOT ' ' |
4159 | -# define QUOTS "" |
4160 | -# endif |
4161 | - |
4162 | -int usage(__G__ error) /* return PK-type error code */ |
4163 | - __GDEF |
4164 | - int error; |
4165 | -{ |
4166 | - int flag = (error? 1 : 0); |
4167 | - |
4168 | - |
4169 | -/*--------------------------------------------------------------------------- |
4170 | - Print either ZipInfo usage or UnZip usage, depending on incantation. |
4171 | - (Strings must be no longer than 512 bytes for Turbo C, apparently.) |
4172 | - ---------------------------------------------------------------------------*/ |
4173 | - |
4174 | - if (uO.zipinfo_mode) { |
4175 | - |
4176 | -#ifndef NO_ZIPINFO |
4177 | - |
4178 | - Info(slide, flag, ((char *)slide, LoadFarString(ZipInfoUsageLine1), |
4179 | - ZI_MAJORVER, ZI_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL, |
4180 | - LoadFarStringSmall(VersionDate), |
4181 | - LoadFarStringSmall2(ZipInfoExample), QUOTS,QUOTS)); |
4182 | - Info(slide, flag, ((char *)slide, LoadFarString(ZipInfoUsageLine2))); |
4183 | - Info(slide, flag, ((char *)slide, LoadFarString(ZipInfoUsageLine3), |
4184 | - LoadFarStringSmall(ZipInfoUsageLine4))); |
4185 | -#ifdef VMS |
4186 | - Info(slide, flag, ((char *)slide, "\n\ |
4187 | -You must quote non-lowercase options and filespecs, unless SET PROC/PARSE=EXT.\ |
4188 | -\n")); |
4189 | -#endif |
4190 | - |
4191 | -#endif /* !NO_ZIPINFO */ |
4192 | - |
4193 | - } else { /* UnZip mode */ |
4194 | - |
4195 | - Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine1), |
4196 | - UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL, |
4197 | - LoadFarStringSmall(VersionDate))); |
4198 | -#ifdef BETA |
4199 | - Info(slide, flag, ((char *)slide, LoadFarString(BetaVersion), "", "")); |
4200 | -#endif |
4201 | - |
4202 | - Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine2), |
4203 | - ZIPINFO_MODE_OPTION, LoadFarStringSmall(ZipInfoMode))); |
4204 | -#ifdef VMS |
4205 | - if (!error) /* maybe no command-line tail found; show extra help */ |
4206 | - Info(slide, flag, ((char *)slide, LoadFarString(VMSusageLine2b))); |
4207 | -#endif |
4208 | - |
4209 | - Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine3), |
4210 | - LoadFarStringSmall(local1))); |
4211 | - |
4212 | - Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine4), |
4213 | - LoadFarStringSmall(local2), LoadFarStringSmall2(local3))); |
4214 | - |
4215 | - /* This is extra work for SMALL_MEM, but it will work since |
4216 | - * LoadFarStringSmall2 uses the same buffer. Remember, this |
4217 | - * is a hack. */ |
4218 | - Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine5), |
4219 | - LoadFarStringSmall(Example2), LoadFarStringSmall2(Example3), |
4220 | - LoadFarStringSmall2(Example3))); |
4221 | - |
4222 | - } /* end if (uO.zipinfo_mode) */ |
4223 | - |
4224 | - if (error) |
4225 | - return PK_PARAM; |
4226 | - else |
4227 | - return PK_COOL; /* just wanted usage screen: no error */ |
4228 | - |
4229 | -} /* end function usage() */ |
4230 | - |
4231 | -#endif /* ?SFX */ |
4232 | - |
4233 | - |
4234 | - |
4235 | - |
4236 | -#ifndef SFX |
4237 | - |
4238 | -/* Print extended help to stdout. */ |
4239 | -static void help_extended(__G) |
4240 | - __GDEF |
4241 | -{ |
4242 | - extent i; /* counter for help array */ |
4243 | - |
4244 | - /* help array */ |
4245 | - static ZCONST char *text[] = { |
4246 | - "", |
4247 | - "Extended Help for UnZip", |
4248 | - "", |
4249 | - "See the UnZip Manual for more detailed help", |
4250 | - "", |
4251 | - "", |
4252 | - "UnZip lists and extracts files in zip archives. The default action is to", |
4253 | - "extract zipfile entries to the current directory, creating directories as", |
4254 | - "needed. With appropriate options, UnZip lists the contents of archives", |
4255 | - "instead.", |
4256 | - "", |
4257 | - "Basic unzip command line:", |
4258 | - " unzip [-Z] options archive[.zip] [file ...] [-x xfile ...] [-d exdir]", |
4259 | - "", |
4260 | - "Some examples:", |
4261 | - " unzip -l foo.zip - list files in short format in archive foo.zip", |
4262 | - "", |
4263 | - " unzip -t foo - test the files in archive foo", |
4264 | - "", |
4265 | - " unzip -Z foo - list files using more detailed zipinfo format", |
4266 | - "", |
4267 | - " unzip foo - unzip the contents of foo in current dir", |
4268 | - "", |
4269 | - " unzip -a foo - unzip foo and convert text files to local OS", |
4270 | - "", |
4271 | - "If unzip is run in zipinfo mode, a more detailed list of archive contents", |
4272 | - "is provided. The -Z option sets zipinfo mode and changes the available", |
4273 | - "options.", |
4274 | - "", |
4275 | - "Basic zipinfo command line:", |
4276 | - " zipinfo options archive[.zip] [file ...] [-x xfile ...]", |
4277 | - " unzip -Z options archive[.zip] [file ...] [-x xfile ...]", |
4278 | - "", |
4279 | - "Below, Mac OS refers to Mac OS before Mac OS X. Mac OS X is a Unix based", |
4280 | - "port and is referred to as Unix Apple.", |
4281 | - "", |
4282 | - "", |
4283 | - "unzip options:", |
4284 | - " -Z Switch to zipinfo mode. Must be first option.", |
4285 | - " -hh Display extended help.", |
4286 | - " -A [OS/2, Unix DLL] Print extended help for DLL.", |
4287 | - " -c Extract files to stdout/screen. As -p but include names. Also,", |
4288 | - " -a allowed and EBCDIC conversions done if needed.", |
4289 | - " -f Freshen by extracting only if older file on disk.", |
4290 | - " -l List files using short form.", |
4291 | - " -p Extract files to pipe (stdout). Only file data is output and all", |
4292 | - " files extracted in binary mode (as stored).", |
4293 | - " -t Test archive files.", |
4294 | - " -T Set timestamp on archive(s) to that of newest file. Similar to", |
4295 | - " zip -o but faster.", |
4296 | - " -u Update existing older files on disk as -f and extract new files.", |
4297 | - " -v Use verbose list format. If given alone as unzip -v show version", |
4298 | - " information. Also can be added to other list commands for more", |
4299 | - " verbose output.", |
4300 | - " -z Display only archive comment.", |
4301 | - "", |
4302 | - "unzip modifiers:", |
4303 | - " -a Convert text files to local OS format. Convert line ends, EOF", |
4304 | - " marker, and from or to EBCDIC character set as needed.", |
4305 | - " -b Treat all files as binary. [Tandem] Force filecode 180 ('C').", |
4306 | - " [VMS] Autoconvert binary files. -bb forces convert of all files.", |
4307 | - " -B [UNIXBACKUP compile option enabled] Save a backup copy of each", |
4308 | - " overwritten file in foo~ or foo~99999 format.", |
4309 | - " -C Use case-insensitive matching.", |
4310 | - " -D Skip restoration of timestamps for extracted directories. On VMS this", |
4311 | - " is on by default and -D essentially becames -DD.", |
4312 | - " -DD Skip restoration of timestamps for all entries.", |
4313 | - " -E [MacOS (not Unix Apple)] Display contents of MacOS extra field during", |
4314 | - " restore.", |
4315 | - " -F [Acorn] Suppress removal of NFS filetype extension. [Non-Acorn if", |
4316 | - " ACORN_FTYPE_NFS] Translate filetype and append to name.", |
4317 | - " -i [MacOS] Ignore filenames in MacOS extra field. Instead, use name in", |
4318 | - " standard header.", |
4319 | - " -j Junk paths and deposit all files in extraction directory.", |
4320 | - " -J [BeOS] Junk file attributes. [MacOS] Ignore MacOS specific info.", |
4321 | - " -K [AtheOS, BeOS, Unix] Restore SUID/SGID/Tacky file attributes.", |
4322 | - " -L Convert to lowercase any names from uppercase only file system.", |
4323 | - " -LL Convert all files to lowercase.", |
4324 | - " -M Pipe all output through internal pager similar to Unix more(1).", |
4325 | - " -n Never overwrite existing files. Skip extracting that file, no prompt.", |
4326 | - " -N [Amiga] Extract file comments as Amiga filenotes.", |
4327 | - " -o Overwrite existing files without prompting. Useful with -f. Use with", |
4328 | - " care.", |
4329 | - " -P p Use password p to decrypt files. THIS IS INSECURE! Some OS show", |
4330 | - " command line to other users.", |
4331 | - " -q Perform operations quietly. The more q (as in -qq) the quieter.", |
4332 | - " -s [OS/2, NT, MS-DOS] Convert spaces in filenames to underscores.", |
4333 | - " -S [VMS] Convert text files (-a, -aa) into Stream_LF format.", |
4334 | - " -U [UNICODE enabled] Show non-local characters as #Uxxxx or #Lxxxxxx ASCII", |
4335 | - " text escapes where x is hex digit. [Old] -U used to leave names", |
4336 | - " uppercase if created on MS-DOS, VMS, etc. See -L.", |
4337 | - " -UU [UNICODE enabled] Disable use of stored UTF-8 paths. Note that UTF-8", |
4338 | - " paths stored as native local paths are still processed as Unicode.", |
4339 | - " -V Retain VMS file version numbers.", |
4340 | - " -W [Only if WILD_STOP_AT_DIR] Modify pattern matching so ? and * do not", |
4341 | - " match directory separator /, but ** does. Allows matching at specific", |
4342 | - " directory levels.", |
4343 | - " -X [VMS, Unix, OS/2, NT, Tandem] Restore UICs and ACL entries under VMS,", |
4344 | - " or UIDs/GIDs under Unix, or ACLs under certain network-enabled", |
4345 | - " versions of OS/2, or security ACLs under Windows NT. Can require", |
4346 | - " user privileges.", |
4347 | - " -XX [NT] Extract NT security ACLs after trying to enable additional", |
4348 | - " system privileges.", |
4349 | - " -Y [VMS] Treat archived name endings of .nnn as VMS version numbers.", |
4350 | - " -$ [MS-DOS, OS/2, NT] Restore volume label if extraction medium is", |
4351 | - " removable. -$$ allows fixed media (hard drives) to be labeled.", |
4352 | - " -/ e [Acorn] Use e as extension list.", |
4353 | - " -: [All but Acorn, VM/CMS, MVS, Tandem] Allow extract archive members into", |
4354 | - " locations outside of current extraction root folder. This allows", |
4355 | - " paths such as ../foo to be extracted above the current extraction", |
4356 | - " directory, which can be a security problem.", |
4357 | - " -^ [Unix] Allow control characters in names of extracted entries. Usually", |
4358 | - " this is not a good thing and should be avoided.", |
4359 | - " -2 [VMS] Force unconditional conversion of names to ODS-compatible names.", |
4360 | - " Default is to exploit destination file system, preserving cases and", |
4361 | - " extended name characters on ODS5 and applying ODS2 filtering on ODS2.", |
4362 | - "", |
4363 | - "", |
4364 | - "Wildcards:", |
4365 | - " Internally unzip supports the following wildcards:", |
4366 | - " ? (or %% or #, depending on OS) matches any single character", |
4367 | - " * matches any number of characters, including zero", |
4368 | - " [list] matches char in list (regex), can do range [ac-f], all but [!bf]", |
4369 | - " If port supports [], must escape [ as [[]", |
4370 | - " For shells that expand wildcards, escape (\\* or \"*\") so unzip can recurse.", |
4371 | - "", |
4372 | - "Include and Exclude:", |
4373 | - " -i pattern pattern ... include files that match a pattern", |
4374 | - " -x pattern pattern ... exclude files that match a pattern", |
4375 | - " Patterns are paths with optional wildcards and match paths as stored in", |
4376 | - " archive. Exclude and include lists end at next option or end of line.", |
4377 | - " unzip archive -x pattern pattern ...", |
4378 | - "", |
4379 | - "Multi-part (split) archives (archives created as a set of split files):", |
4380 | - " Currently split archives are not readable by unzip. A workaround is", |
4381 | - " to use zip to convert the split archive to a single-file archive and", |
4382 | - " use unzip on that. See the manual page for Zip 3.0 or later.", |
4383 | - "", |
4384 | - "Streaming (piping into unzip):", |
4385 | - " Currently unzip does not support streaming. The funzip utility can be", |
4386 | - " used to process the first entry in a stream.", |
4387 | - " cat archive | funzip", |
4388 | - "", |
4389 | - "Testing archives:", |
4390 | - " -t test contents of archive", |
4391 | - " This can be modified using -q for quieter operation, and -qq for even", |
4392 | - " quieter operation.", |
4393 | - "", |
4394 | - "Unicode:", |
4395 | - " If compiled with Unicode support, unzip automatically handles archives", |
4396 | - " with Unicode entries. Currently Unicode on Win32 systems is limited.", |
4397 | - " Characters not in the current character set are shown as ASCII escapes", |
4398 | - " in the form #Uxxxx where the Unicode character number fits in 16 bits,", |
4399 | - " or #Lxxxxxx where it doesn't, where x is the ASCII character for a hex", |
4400 | - " digit.", |
4401 | - "", |
4402 | - "", |
4403 | - "zipinfo options (these are used in zipinfo mode (unzip -Z ...)):", |
4404 | - " -1 List names only, one per line. No headers/trailers. Good for scripts.", |
4405 | - " -2 List names only as -1, but include headers, trailers, and comments.", |
4406 | - " -s List archive entries in short Unix ls -l format. Default list format.", |
4407 | - " -m List in long Unix ls -l format. As -s, but includes compression %.", |
4408 | - " -l List in long Unix ls -l format. As -m, but compression in bytes.", |
4409 | - " -v List zipfile information in verbose, multi-page format.", |
4410 | - " -h List header line. Includes archive name, actual size, total files.", |
4411 | - " -M Pipe all output through internal pager similar to Unix more(1) command.", |
4412 | - " -t List totals for files listed or for all files. Includes uncompressed", |
4413 | - " and compressed sizes, and compression factors.", |
4414 | - " -T Print file dates and times in a sortable decimal format (yymmdd.hhmmss)", |
4415 | - " Default date and time format is a more human-readable version.", |
4416 | - " -U [UNICODE] If entry has a UTF-8 Unicode path, display any characters", |
4417 | - " not in current character set as text #Uxxxx and #Lxxxxxx escapes", |
4418 | - " representing the Unicode character number of the character in hex.", |
4419 | - " -UU [UNICODE] Disable use of any UTF-8 path information.", |
4420 | - " -z Include archive comment if any in listing.", |
4421 | - "", |
4422 | - "", |
4423 | - "funzip stream extractor:", |
4424 | - " funzip extracts the first member in an archive to stdout. Typically", |
4425 | - " used to unzip the first member of a stream or pipe. If a file argument", |
4426 | - " is given, read from that file instead of stdin.", |
4427 | - "", |
4428 | - "funzip command line:", |
4429 | - " funzip [-password] [input[.zip|.gz]]", |
4430 | - "", |
4431 | - "", |
4432 | - "unzipsfx self extractor:", |
4433 | - " Self-extracting archives made with unzipsfx are no more (or less)", |
4434 | - " portable across different operating systems than unzip executables.", |
4435 | - " In general, a self-extracting archive made on a particular Unix system,", |
4436 | - " for example, will only self-extract under the same flavor of Unix.", |
4437 | - " Regular unzip may still be used to extract embedded archive however.", |
4438 | - "", |
4439 | - "unzipsfx command line:", |
4440 | - " <unzipsfx+archive_filename> [-options] [file(s) ... [-x xfile(s) ...]]", |
4441 | - "", |
4442 | - "unzipsfx options:", |
4443 | - " -c, -p - Output to pipe. (See above for unzip.)", |
4444 | - " -f, -u - Freshen and Update, as for unzip.", |
4445 | - " -t - Test embedded archive. (Can be used to list contents.)", |
4446 | - " -z - Print archive comment. (See unzip above.)", |
4447 | - "", |
4448 | - "unzipsfx modifiers:", |
4449 | - " Most unzip modifiers are supported. These include", |
4450 | - " -a - Convert text files.", |
4451 | - " -n - Never overwrite.", |
4452 | - " -o - Overwrite without prompting.", |
4453 | - " -q - Quiet operation.", |
4454 | - " -C - Match names case-insensitively.", |
4455 | - " -j - Junk paths.", |
4456 | - " -V - Keep version numbers.", |
4457 | - " -s - Convert spaces to underscores.", |
4458 | - " -$ - Restore volume label.", |
4459 | - "", |
4460 | - "If unzipsfx compiled with SFX_EXDIR defined, -d option also available:", |
4461 | - " -d exd - Extract to directory exd.", |
4462 | - "By default, all files extracted to current directory. This option", |
4463 | - "forces extraction to specified directory.", |
4464 | - "", |
4465 | - "See unzipsfx manual page for more information.", |
4466 | - "" |
4467 | - }; |
4468 | - |
4469 | - for (i = 0; i < sizeof(text)/sizeof(char *); i++) |
4470 | - { |
4471 | - Info(slide, 0, ((char *)slide, "%s\n", text[i])); |
4472 | - } |
4473 | -} /* end function help_extended() */ |
4474 | - |
4475 | - |
4476 | - |
4477 | - |
4478 | -#ifndef _WIN32_WCE /* Win CE does not support environment variables */ |
4479 | -#if (!defined(MODERN) || defined(NO_STDLIB_H)) |
4480 | -/* Declare getenv() to be sure (might be missing in some environments) */ |
4481 | -extern char *getenv(); |
4482 | -#endif |
4483 | -#endif |
4484 | - |
4485 | -/********************************/ |
4486 | -/* Function show_version_info() */ |
4487 | -/********************************/ |
4488 | - |
4489 | -static void show_version_info(__G) |
4490 | - __GDEF |
4491 | -{ |
4492 | - if (uO.qflag > 3) /* "unzip -vqqqq" */ |
4493 | - Info(slide, 0, ((char *)slide, "%d\n", |
4494 | - (UZ_MAJORVER*100 + UZ_MINORVER*10 + UZ_PATCHLEVEL))); |
4495 | - else { |
4496 | -#ifndef _WIN32_WCE /* Win CE does not support environment variables */ |
4497 | - char *envptr; |
4498 | -#endif |
4499 | - int numopts = 0; |
4500 | - |
4501 | - Info(slide, 0, ((char *)slide, LoadFarString(UnzipUsageLine1v), |
4502 | - UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL, |
4503 | - LoadFarStringSmall(VersionDate))); |
4504 | - Info(slide, 0, ((char *)slide, |
4505 | - LoadFarString(UnzipUsageLine2v))); |
4506 | - version(__G); |
4507 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptions))); |
4508 | -#ifdef ACORN_FTYPE_NFS |
4509 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4510 | - LoadFarStringSmall(AcornFtypeNFS))); |
4511 | - ++numopts; |
4512 | -#endif |
4513 | -#ifdef ASM_CRC |
4514 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4515 | - LoadFarStringSmall(AsmCRC))); |
4516 | - ++numopts; |
4517 | -#endif |
4518 | -#ifdef ASM_INFLATECODES |
4519 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4520 | - LoadFarStringSmall(AsmInflateCodes))); |
4521 | - ++numopts; |
4522 | -#endif |
4523 | -#ifdef CHECK_VERSIONS |
4524 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4525 | - LoadFarStringSmall(Check_Versions))); |
4526 | - ++numopts; |
4527 | -#endif |
4528 | -#ifdef COPYRIGHT_CLEAN |
4529 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4530 | - LoadFarStringSmall(Copyright_Clean))); |
4531 | - ++numopts; |
4532 | -#endif |
4533 | -#ifdef DEBUG |
4534 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4535 | - LoadFarStringSmall(UDebug))); |
4536 | - ++numopts; |
4537 | -#endif |
4538 | -#ifdef DEBUG_TIME |
4539 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4540 | - LoadFarStringSmall(DebugTime))); |
4541 | - ++numopts; |
4542 | -#endif |
4543 | -#ifdef DLL |
4544 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4545 | - LoadFarStringSmall(Dll))); |
4546 | - ++numopts; |
4547 | -#endif |
4548 | -#ifdef DOSWILD |
4549 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4550 | - LoadFarStringSmall(DosWild))); |
4551 | - ++numopts; |
4552 | -#endif |
4553 | -#ifdef LZW_CLEAN |
4554 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4555 | - LoadFarStringSmall(LZW_Clean))); |
4556 | - ++numopts; |
4557 | -#endif |
4558 | -#ifndef MORE |
4559 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4560 | - LoadFarStringSmall(No_More))); |
4561 | - ++numopts; |
4562 | -#endif |
4563 | -#ifdef NO_ZIPINFO |
4564 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4565 | - LoadFarStringSmall(No_ZipInfo))); |
4566 | - ++numopts; |
4567 | -#endif |
4568 | -#ifdef NTSD_EAS |
4569 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4570 | - LoadFarStringSmall(NTSDExtAttrib))); |
4571 | - ++numopts; |
4572 | -#endif |
4573 | -#if defined(WIN32) && defined(NO_W32TIMES_IZFIX) |
4574 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4575 | - LoadFarStringSmall(W32NoIZTimeFix))); |
4576 | - ++numopts; |
4577 | -#endif |
4578 | -#ifdef OLD_THEOS_EXTRA |
4579 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4580 | - LoadFarStringSmall(OldTheosExtra))); |
4581 | - ++numopts; |
4582 | -#endif |
4583 | -#ifdef OS2_EAS |
4584 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4585 | - LoadFarStringSmall(OS2ExtAttrib))); |
4586 | - ++numopts; |
4587 | -#endif |
4588 | -#ifdef QLZIP |
4589 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4590 | - LoadFarStringSmall(SMSExFldOnUnix))); |
4591 | - ++numopts; |
4592 | -#endif |
4593 | -#ifdef REENTRANT |
4594 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4595 | - LoadFarStringSmall(Reentrant))); |
4596 | - ++numopts; |
4597 | -#endif |
4598 | -#ifdef REGARGS |
4599 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4600 | - LoadFarStringSmall(RegArgs))); |
4601 | - ++numopts; |
4602 | -#endif |
4603 | -#ifdef RETURN_CODES |
4604 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4605 | - LoadFarStringSmall(Return_Codes))); |
4606 | - ++numopts; |
4607 | -#endif |
4608 | -#ifdef SET_DIR_ATTRIB |
4609 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4610 | - LoadFarStringSmall(SetDirAttrib))); |
4611 | - ++numopts; |
4612 | -#endif |
4613 | -#ifdef SYMLINKS |
4614 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4615 | - LoadFarStringSmall(SymLinkSupport))); |
4616 | - ++numopts; |
4617 | -#endif |
4618 | -#ifdef TIMESTAMP |
4619 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4620 | - LoadFarStringSmall(TimeStamp))); |
4621 | - ++numopts; |
4622 | -#endif |
4623 | -#ifdef UNIXBACKUP |
4624 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4625 | - LoadFarStringSmall(UnixBackup))); |
4626 | - ++numopts; |
4627 | -#endif |
4628 | -#ifdef USE_EF_UT_TIME |
4629 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4630 | - LoadFarStringSmall(Use_EF_UT_time))); |
4631 | - ++numopts; |
4632 | -#endif |
4633 | -#ifndef COPYRIGHT_CLEAN |
4634 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4635 | - LoadFarStringSmall(Use_Smith_Code))); |
4636 | - ++numopts; |
4637 | -#endif |
4638 | -#ifndef LZW_CLEAN |
4639 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4640 | - LoadFarStringSmall(Use_Unshrink))); |
4641 | - ++numopts; |
4642 | -#endif |
4643 | -#ifdef USE_DEFLATE64 |
4644 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4645 | - LoadFarStringSmall(Use_Deflate64))); |
4646 | - ++numopts; |
4647 | -#endif |
4648 | -#ifdef UNICODE_SUPPORT |
4649 | -# ifdef UTF8_MAYBE_NATIVE |
4650 | - sprintf((char *)(slide+256), LoadFarStringSmall(Use_Unicode), |
4651 | - LoadFarStringSmall2(G.native_is_utf8 ? SysChUTF8 : SysChOther)); |
4652 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4653 | - (char *)(slide+256))); |
4654 | -# else |
4655 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4656 | - LoadFarStringSmall(Use_Unicode))); |
4657 | -# endif |
4658 | - ++numopts; |
4659 | -#endif |
4660 | -#ifdef _MBCS |
4661 | - sprintf((char *)(slide+256), LoadFarStringSmall(Have_MBCS_Support), |
4662 | - (unsigned int)MB_CUR_MAX); |
4663 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4664 | - (char *)(slide+256))); |
4665 | - ++numopts; |
4666 | -#endif |
4667 | -#ifdef MULT_VOLUME |
4668 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4669 | - LoadFarStringSmall(Use_MultiVol))); |
4670 | - ++numopts; |
4671 | -#endif |
4672 | -#ifdef LARGE_FILE_SUPPORT |
4673 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4674 | - LoadFarStringSmall(Use_LFS))); |
4675 | - ++numopts; |
4676 | -#endif |
4677 | -#ifdef ZIP64_SUPPORT |
4678 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4679 | - LoadFarStringSmall(Use_Zip64))); |
4680 | - ++numopts; |
4681 | -#endif |
4682 | -#if (defined(__DJGPP__) && (__DJGPP__ >= 2)) |
4683 | -# ifdef USE_DJGPP_ENV |
4684 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4685 | - LoadFarStringSmall(Use_DJGPP_Env))); |
4686 | - ++numopts; |
4687 | -# endif |
4688 | -# ifdef USE_DJGPP_GLOB |
4689 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4690 | - LoadFarStringSmall(Use_DJGPP_Glob))); |
4691 | - ++numopts; |
4692 | -# endif |
4693 | -#endif /* __DJGPP__ && (__DJGPP__ >= 2) */ |
4694 | -#ifdef USE_VFAT |
4695 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4696 | - LoadFarStringSmall(Use_VFAT_support))); |
4697 | - ++numopts; |
4698 | -#endif |
4699 | -#ifdef USE_ZLIB |
4700 | - sprintf((char *)(slide+256), LoadFarStringSmall(UseZlib), |
4701 | - ZLIB_VERSION, zlibVersion()); |
4702 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4703 | - (char *)(slide+256))); |
4704 | - ++numopts; |
4705 | -#endif |
4706 | -#ifdef USE_BZIP2 |
4707 | - sprintf((char *)(slide+256), LoadFarStringSmall(UseBZip2), |
4708 | - BZ2_bzlibVersion()); |
4709 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4710 | - (char *)(slide+256))); |
4711 | - ++numopts; |
4712 | -#endif |
4713 | -#ifdef VMS_TEXT_CONV |
4714 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4715 | - LoadFarStringSmall(VmsTextConv))); |
4716 | - ++numopts; |
4717 | -#endif |
4718 | -#ifdef VMSCLI |
4719 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4720 | - LoadFarStringSmall(VmsCLI))); |
4721 | - ++numopts; |
4722 | -#endif |
4723 | -#ifdef VMSWILD |
4724 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4725 | - LoadFarStringSmall(VmsWild))); |
4726 | - ++numopts; |
4727 | -#endif |
4728 | -#ifdef WILD_STOP_AT_DIR |
4729 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4730 | - LoadFarStringSmall(WildStopAtDir))); |
4731 | - ++numopts; |
4732 | -#endif |
4733 | -#if CRYPT |
4734 | -# ifdef PASSWD_FROM_STDIN |
4735 | - Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat), |
4736 | - LoadFarStringSmall(PasswdStdin))); |
4737 | -# endif |
4738 | - Info(slide, 0, ((char *)slide, LoadFarString(Decryption), |
4739 | - CR_MAJORVER, CR_MINORVER, CR_BETA_VER, |
4740 | - LoadFarStringSmall(CryptDate))); |
4741 | - ++numopts; |
4742 | -#endif /* CRYPT */ |
4743 | - if (numopts == 0) |
4744 | - Info(slide, 0, ((char *)slide, |
4745 | - LoadFarString(CompileOptFormat), |
4746 | - LoadFarStringSmall(None))); |
4747 | - |
4748 | -#ifndef _WIN32_WCE /* Win CE does not support environment variables */ |
4749 | - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptions))); |
4750 | - envptr = getenv(LoadFarStringSmall(EnvUnZip)); |
4751 | - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), |
4752 | - LoadFarStringSmall(EnvUnZip), |
4753 | - (envptr == (char *)NULL || *envptr == 0)? |
4754 | - LoadFarStringSmall2(None) : envptr)); |
4755 | - envptr = getenv(LoadFarStringSmall(EnvUnZip2)); |
4756 | - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), |
4757 | - LoadFarStringSmall(EnvUnZip2), |
4758 | - (envptr == (char *)NULL || *envptr == 0)? |
4759 | - LoadFarStringSmall2(None) : envptr)); |
4760 | - envptr = getenv(LoadFarStringSmall(EnvZipInfo)); |
4761 | - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), |
4762 | - LoadFarStringSmall(EnvZipInfo), |
4763 | - (envptr == (char *)NULL || *envptr == 0)? |
4764 | - LoadFarStringSmall2(None) : envptr)); |
4765 | - envptr = getenv(LoadFarStringSmall(EnvZipInfo2)); |
4766 | - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), |
4767 | - LoadFarStringSmall(EnvZipInfo2), |
4768 | - (envptr == (char *)NULL || *envptr == 0)? |
4769 | - LoadFarStringSmall2(None) : envptr)); |
4770 | -#ifndef __RSXNT__ |
4771 | -#ifdef __EMX__ |
4772 | - envptr = getenv(LoadFarStringSmall(EnvEMX)); |
4773 | - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), |
4774 | - LoadFarStringSmall(EnvEMX), |
4775 | - (envptr == (char *)NULL || *envptr == 0)? |
4776 | - LoadFarStringSmall2(None) : envptr)); |
4777 | - envptr = getenv(LoadFarStringSmall(EnvEMXOPT)); |
4778 | - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), |
4779 | - LoadFarStringSmall(EnvEMXOPT), |
4780 | - (envptr == (char *)NULL || *envptr == 0)? |
4781 | - LoadFarStringSmall2(None) : envptr)); |
4782 | -#endif /* __EMX__ */ |
4783 | -#if (defined(__GO32__) && (!defined(__DJGPP__) || (__DJGPP__ < 2))) |
4784 | - envptr = getenv(LoadFarStringSmall(EnvGO32)); |
4785 | - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), |
4786 | - LoadFarStringSmall(EnvGO32), |
4787 | - (envptr == (char *)NULL || *envptr == 0)? |
4788 | - LoadFarStringSmall2(None) : envptr)); |
4789 | - envptr = getenv(LoadFarStringSmall(EnvGO32TMP)); |
4790 | - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), |
4791 | - LoadFarStringSmall(EnvGO32TMP), |
4792 | - (envptr == (char *)NULL || *envptr == 0)? |
4793 | - LoadFarStringSmall2(None) : envptr)); |
4794 | -#endif /* __GO32__ && !(__DJGPP__ >= 2) */ |
4795 | -#endif /* !__RSXNT__ */ |
4796 | -#ifdef RISCOS |
4797 | - envptr = getenv(LoadFarStringSmall(EnvUnZipExts)); |
4798 | - Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat), |
4799 | - LoadFarStringSmall(EnvUnZipExts), |
4800 | - (envptr == (char *)NULL || *envptr == 0)? |
4801 | - LoadFarStringSmall2(None) : envptr)); |
4802 | -#endif /* RISCOS */ |
4803 | -#endif /* !_WIN32_WCE */ |
4804 | - } |
4805 | -} /* end function show_version() */ |
4806 | - |
4807 | -#endif /* !SFX */ |
4808 | -#endif /* !WINDLL */ |
4809 | |
4810 | === removed directory '.pc/03-include-unistd-for-kfreebsd' |
4811 | === removed directory '.pc/03-include-unistd-for-kfreebsd/unix' |
4812 | === removed file '.pc/03-include-unistd-for-kfreebsd/unix/unxcfg.h' |
4813 | --- .pc/03-include-unistd-for-kfreebsd/unix/unxcfg.h 2010-02-21 17:01:00 +0000 |
4814 | +++ .pc/03-include-unistd-for-kfreebsd/unix/unxcfg.h 1970-01-01 00:00:00 +0000 |
4815 | @@ -1,230 +0,0 @@ |
4816 | -/* |
4817 | - Copyright (c) 1990-2009 Info-ZIP. All rights reserved. |
4818 | - |
4819 | - See the accompanying file LICENSE, version 2009-Jan-02 or later |
4820 | - (the contents of which are also included in unzip.h) for terms of use. |
4821 | - If, for some reason, all these files are missing, the Info-ZIP license |
4822 | - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html |
4823 | -*/ |
4824 | -/*--------------------------------------------------------------------------- |
4825 | - Unix specific configuration section: |
4826 | - ---------------------------------------------------------------------------*/ |
4827 | - |
4828 | -#ifndef __unxcfg_h |
4829 | -#define __unxcfg_h |
4830 | - |
4831 | - |
4832 | -/* LARGE FILE SUPPORT - 10/6/04 EG */ |
4833 | -/* This needs to be set before the includes so they set the right sizes */ |
4834 | - |
4835 | -#if (defined(NO_LARGE_FILE_SUPPORT) && defined(LARGE_FILE_SUPPORT)) |
4836 | -# undef LARGE_FILE_SUPPORT |
4837 | -#endif |
4838 | - |
4839 | -/* Automatically set ZIP64_SUPPORT if LFS */ |
4840 | -#ifdef LARGE_FILE_SUPPORT |
4841 | -# if (!defined(NO_ZIP64_SUPPORT) && !defined(ZIP64_SUPPORT)) |
4842 | -# define ZIP64_SUPPORT |
4843 | -# endif |
4844 | -#endif |
4845 | - |
4846 | -/* NO_ZIP64_SUPPORT takes preceedence over ZIP64_SUPPORT */ |
4847 | -#if defined(NO_ZIP64_SUPPORT) && defined(ZIP64_SUPPORT) |
4848 | -# undef ZIP64_SUPPORT |
4849 | -#endif |
4850 | - |
4851 | -#ifdef LARGE_FILE_SUPPORT |
4852 | - /* 64-bit Large File Support */ |
4853 | - |
4854 | - /* The following Large File Summit (LFS) defines turn on large file support |
4855 | - on Linux (probably 2.4 or later kernel) and many other unixen */ |
4856 | - |
4857 | - /* These have to be before any include that sets types so the large file |
4858 | - versions of the types are set in the includes */ |
4859 | - |
4860 | -# define _LARGEFILE_SOURCE /* some OSes need this for fseeko */ |
4861 | -# define _LARGEFILE64_SOURCE |
4862 | -# define _FILE_OFFSET_BITS 64 /* select default interface as 64 bit */ |
4863 | -# define _LARGE_FILES /* some OSes need this for 64-bit off_t */ |
4864 | -# define __USE_LARGEFILE64 |
4865 | -#endif /* LARGE_FILE_SUPPORT */ |
4866 | - |
4867 | - |
4868 | -#include <sys/types.h> /* off_t, time_t, dev_t, ... */ |
4869 | -#include <sys/stat.h> |
4870 | - |
4871 | -#ifdef NO_OFF_T |
4872 | - typedef long zoff_t; |
4873 | -#else |
4874 | - typedef off_t zoff_t; |
4875 | -#endif |
4876 | -#define ZOFF_T_DEFINED |
4877 | -typedef struct stat z_stat; |
4878 | -#define Z_STAT_DEFINED |
4879 | - |
4880 | -#ifndef COHERENT |
4881 | -# include <fcntl.h> /* O_BINARY for open() w/o CR/LF translation */ |
4882 | -#else /* COHERENT */ |
4883 | -# ifdef _I386 |
4884 | -# include <fcntl.h> /* Coherent 4.0.x, Mark Williams C */ |
4885 | -# else |
4886 | -# include <sys/fcntl.h> /* Coherent 3.10, Mark Williams C */ |
4887 | -# endif |
4888 | -# define SHORT_SYMS |
4889 | -# ifndef __COHERENT__ /* Coherent 4.2 has tzset() */ |
4890 | -# define tzset settz |
4891 | -# endif |
4892 | -#endif /* ?COHERENT */ |
4893 | - |
4894 | -#ifndef NO_PARAM_H |
4895 | -# ifdef NGROUPS_MAX |
4896 | -# undef NGROUPS_MAX /* SCO bug: defined again in <sys/param.h> */ |
4897 | -# endif |
4898 | -# ifdef BSD |
4899 | -# define TEMP_BSD /* may be defined again in <sys/param.h> */ |
4900 | -# undef BSD |
4901 | -# endif |
4902 | -# include <sys/param.h> /* conflict with <sys/types.h>, some systems? */ |
4903 | -# ifdef TEMP_BSD |
4904 | -# undef TEMP_BSD |
4905 | -# ifndef BSD |
4906 | -# define BSD |
4907 | -# endif |
4908 | -# endif |
4909 | -#endif /* !NO_PARAM_H */ |
4910 | - |
4911 | -#ifdef __osf__ |
4912 | -# define DIRENT |
4913 | -# ifdef BSD |
4914 | -# undef BSD |
4915 | -# endif |
4916 | -#endif /* __osf__ */ |
4917 | - |
4918 | -#ifdef __CYGWIN__ |
4919 | -# include <unistd.h> |
4920 | -# define DIRENT |
4921 | -# define HAVE_TERMIOS_H |
4922 | -# ifndef timezone |
4923 | -# define timezone _timezone |
4924 | -# endif |
4925 | -#endif |
4926 | - |
4927 | -#ifdef BSD |
4928 | -# include <sys/time.h> |
4929 | -# include <sys/timeb.h> |
4930 | -# if (defined(_AIX) || defined(__GLIBC__) || defined(__GNU__)) |
4931 | -# include <time.h> |
4932 | -# endif |
4933 | -#else |
4934 | -# include <time.h> |
4935 | - struct tm *gmtime(), *localtime(); |
4936 | -#endif |
4937 | - |
4938 | -#if (defined(BSD4_4) || (defined(SYSV) && defined(MODERN))) |
4939 | -# include <unistd.h> /* this includes utime.h on SGIs */ |
4940 | -# if (defined(BSD4_4) || defined(linux) || defined(__GLIBC__)) |
4941 | -# include <utime.h> |
4942 | -# define GOT_UTIMBUF |
4943 | -# endif |
4944 | -# if (!defined(GOT_UTIMBUF) && (defined(__hpux) || defined(__SUNPRO_C))) |
4945 | -# include <utime.h> |
4946 | -# define GOT_UTIMBUF |
4947 | -# endif |
4948 | -# if (!defined(GOT_UTIMBUF) && defined(__GNU__)) |
4949 | -# include <utime.h> |
4950 | -# define GOT_UTIMBUF |
4951 | -# endif |
4952 | -#endif |
4953 | -#if (defined(__DGUX__) && !defined(GOT_UTIMBUF)) |
4954 | - /* DG/UX requires this because of a non-standard struct utimebuf */ |
4955 | -# include <utime.h> |
4956 | -# define GOT_UTIMBUF |
4957 | -#endif |
4958 | - |
4959 | -#if (defined(V7) || defined(pyr_bsd)) |
4960 | -# define strchr index |
4961 | -# define strrchr rindex |
4962 | -#endif |
4963 | -#ifdef V7 |
4964 | -# define O_RDONLY 0 |
4965 | -# define O_WRONLY 1 |
4966 | -# define O_RDWR 2 |
4967 | -#endif |
4968 | - |
4969 | -#if defined(NO_UNICODE_SUPPORT) && defined(UNICODE_SUPPORT) |
4970 | - /* disable Unicode (UTF-8) support when requested */ |
4971 | -# undef UNICODE_SUPPORT |
4972 | -#endif |
4973 | - |
4974 | -#if (defined(_MBCS) && defined(NO_MBCS)) |
4975 | - /* disable MBCS support when requested */ |
4976 | -# undef _MBCS |
4977 | -#endif |
4978 | - |
4979 | -#if (!defined(NO_SETLOCALE) && !defined(_MBCS)) |
4980 | -# if (!defined(UNICODE_SUPPORT) || !defined(UTF8_MAYBE_NATIVE)) |
4981 | - /* enable setlocale here, unless this happens later for UTF-8 and/or |
4982 | - * MBCS support */ |
4983 | -# include <locale.h> |
4984 | -# ifndef SETLOCALE |
4985 | -# define SETLOCALE(category, locale) setlocale(category, locale) |
4986 | -# endif |
4987 | -# endif |
4988 | -#endif |
4989 | -#ifndef NO_SETLOCALE |
4990 | -# if (!defined(NO_WORKING_ISPRINT) && !defined(HAVE_WORKING_ISPRINT)) |
4991 | - /* enable "enhanced" unprintable chars detection in fnfilter() */ |
4992 | -# define HAVE_WORKING_ISPRINT |
4993 | -# endif |
4994 | -#endif |
4995 | - |
4996 | -#ifdef MINIX |
4997 | -# include <stdio.h> |
4998 | -#endif |
4999 | -#if (!defined(HAVE_STRNICMP) & !defined(NO_STRNICMP)) |
5000 | -# define NO_STRNICMP |
The diff has been truncated for viewing.
Good work! :)