unzip/unzip-no_file_name_translation.patch

97 lines
3.8 KiB
Diff

--- man/zipinfo.1-dist 2007-04-25 12:18:27.000000000 +0200
+++ man/zipinfo.1 2007-04-25 12:19:43.000000000 +0200
@@ -114,7 +114,10 @@
.TP
.B \-s
list zipfile info in short Unix ``\fCls \-l\fR'' format. This is the default
-behavior; see below.
+behavior; see \fB\-m option below.
+.TP
+.B \-S
+suppress the conversion of file name encodings.
.TP
.B \-m
list zipfile info in medium Unix ``\fCls \-l\fR'' format. Identical to the
--- man/unzip.1-dist 2007-04-25 12:04:20.000000000 +0200
+++ man/unzip.1 2007-04-25 12:19:54.000000000 +0200
@@ -25,7 +25,7 @@
unzip \- list, test and extract compressed files in a ZIP archive
.PD
.SH SYNOPSIS
-\fBunzip\fP [\fB\-Z\fP] [\fB\-cflptTuvz\fP[\fBabjnoqsCKLMOVX$/:\fP]]
+\fBunzip\fP [\fB\-Z\fP] [\fB\-cflptTuvz\fP[\fBabjnoqsCKLMOSVX$/:\fP]]
\fIfile\fP[\fI.zip\fP] [\fIfile(s)\fP\ .\|.\|.]
[\fB\-x\fP\ \fIxfile(s)\fP\ .\|.\|.] [\fB\-d\fP\ \fIexdir\fP]
.PD
@@ -371,6 +371,11 @@
spaces in filenames. Conversion of spaces to underscores can eliminate the
awkwardness in some cases.
.TP
+.B \-S
+suppress the conversion of file name encodings. This is useful when an
+archive contains file names with non-latin letters. You have to convert
+the file names appropriately to your native encoding manually afterwards.
+.TP
.B \-U
(obsolete; to be removed in a future release) leave filenames uppercase if
created under MS-DOS, VMS, etc. See \fB\-L\fP above.
--- unzpriv.h-dist 2007-04-25 11:55:59.000000000 +0200
+++ unzpriv.h 2007-04-25 12:12:22.000000000 +0200
@@ -2577,6 +2577,7 @@ char *GetLoadPath OF((__GPRO));
*/
#ifndef Ext_ASCII_TO_Native
# define Ext_ASCII_TO_Native(string, hostnum, hostver, isuxatt, islochdr) \
+ if (uO.no_conv_enc == FALSE) { \
if (((hostnum) == FS_FAT_ && \
!(((islochdr) || (isuxatt)) && \
((hostver) == 25 || (hostver) == 26 || (hostver) == 40))) || \
@@ -2585,7 +2586,7 @@ char *GetLoadPath OF((__GPRO));
_OEM_INTERN((string)); \
} else { \
_ISO_INTERN((string)); \
- }
+ }}
#endif
--- zipinfo.c-dist 2007-04-25 12:17:17.000000000 +0200
+++ zipinfo.c 2007-04-25 12:18:09.000000000 +0200
@@ -517,6 +517,12 @@ int zi_opts(__G__ pargc, pargv)
else
uO.lflag = 3;
break;
+ case 'S': /* suppress encoding conversion */
+ if (negative)
+ uO.no_conv_enc = FALSE, negative = 0;
+ else
+ uO.no_conv_enc = TRUE;
+ break;
case 't': /* totals line */
if (negative)
tflag_2v = tflag_slm = FALSE, negative = 0;
--- unzip.c-dist 2007-04-25 11:58:44.000000000 +0200
+++ unzip.c 2007-04-25 12:12:35.000000000 +0200
@@ -1416,6 +1416,12 @@ int uz_opts(__G__ pargc, pargv)
uO.sflag = TRUE;
break;
#endif /* DOS_FLX_NLM_OS2_W32 */
+ case ('S'): /* suppress file name encoding conversions */
+ if (negative)
+ uO.no_conv_enc = FALSE, negative = 0;
+ else
+ uO.no_conv_enc = TRUE;
+ break;
case ('t'):
if (negative)
uO.tflag = FALSE, negative = 0;
--- unzip.h-dist 2007-04-25 11:59:03.000000000 +0200
+++ unzip.h 2007-04-25 12:12:11.000000000 +0200
@@ -478,6 +478,7 @@ typedef struct _UzpOpts {
#if (defined(MSDOS) || defined(FLEXOS) || defined(OS2) || defined(WIN32))
int sflag; /* -s: convert spaces in filenames to underscores */
#endif
+ int no_conv_enc; /* -S: suppress encoding conversion */
#if (defined(NLM))
int sflag; /* -s: convert spaces in filenames to underscores */
#endif