Re: unzip-5.51d
Darren Salt <ds-Ym6Ivm/Ks7B65+NM0QMiFAbYiX8G1TQY9dF7HbQ/[email protected]> Mon, 01 Mar 2004 22:10:27 +0000
| Newsgroups | gmane.comp.archivers.info-zip |
|---|---|
| Message-ID | <4C890C0C9A%[email protected]> |
This message is in MIME format which your mailer apparently does not support.
You either require a newer version of your software which supports MIME, or
a separate MIME decoding utility. Alternatively, ask the sender of this
message to resend it in a different format.
--50242669--1011833074--859453467
Content-Type: text/plain; charset=us-ascii
Another patch for 5.51d. This one turns the WILD_STOP_AT_DIR compile-time
option into a command-line option -W.
--
| Darren Salt | d youmustbejoking.demon.co.uk | nr. Ashington,
| Running Debian | s zap.tartarus.org | Northumberland
| and RISC OS | @ | Toon Army
| Let's keep the pound sterling
Three and a third tridents == one decadent.
--50242669--1011833074--859453467
Content-Type: text/plain; charset=iso-8859-1; name="unzip--W-option.patch"
Content-Disposition: attachment; filename="unzip--W-option.patch"
Content-Transfer-Encoding: quoted-printable
diff -ur/c:h:s unzip~/match.c unzip/match.c
--- unzip~/match.c 2004-03-01 21:58:04.0 +0000
+++ unzip/match.c 2004-03-01 21:58:04.0 +0000
@@ -176,13 +176,11 @@
return *s =3D=3D 0;
=20
/* '?' (or '%') matches any character (but not an empty string).
- * If WILD_STOP_AT_DIR is defined, it won't match '/' */
+ * If uO.W_flag is non-zero, it won't match '/' */
if (c =3D=3D WILDCHAR)
-#ifdef WILD_STOP_AT_DIR
- return (*s && *s !=3D '/') ? recmatch(p, s + CLEN(s), ic) : 0;
-#else
- return *s ? recmatch(p, s + CLEN(s), ic) : 0;
-#endif
+ return uO.W_flag
+ ? ((*s && *s !=3D '/') ? recmatch(p, s + CLEN(s), ic) : 0=
)
+ : (*s ? recmatch(p, s + CLEN(s), ic) : 0);
=20
/* '*' matches any number of characters, including zero */
#ifdef AMIGA
@@ -190,13 +188,13 @@
c =3D '*', p++;
#endif /* AMIGA */
if (c =3D=3D '*') {
-#ifdef WILD_STOP_AT_DIR
+ if (uO.W_flag) {
# ifdef AMIGA
- if ((c =3D p[0]) =3D=3D '#' && p[1] =3D=3D '?') /* "#?" is Amiga=
-ese for "*" */
+ if ((c =3D p[0]) =3D=3D '#' && p[1] =3D=3D '?') /* "#?" is Ami=
ga-ese for "*" */
c =3D '*', p++;
- if (c !=3D '*') {
+ if (c !=3D '*') {
# else /* !AMIGA */
- if (*p !=3D '*') {
+ if (*p !=3D '*') {
# endif /* ?AMIGA */
/* single '*': this doesn't match slashes */
for (; *s && *s !=3D '/'; INCSTR(s))
@@ -208,11 +206,11 @@
/* continue to match if at '/' in pattern, else give up */
return (*p =3D=3D '/' || (*p =3D=3D '\\' && p[1] =3D=3D '/')=
)
? recmatch(p, s, ic) : 2;
+ }
+ /* '**': this matches slashes */
+ ++p; /* move p behind the second '*' */
+ /* continue with the non-WILD_STOP_AT_DIR code variant */
}
- /* '**': this matches slashes */
- ++p; /* move p behind the second '*' */
- /* continue with the non-WILD_STOP_AT_DIR code variant */
-#endif /* WILD_STOP_AT_DIR */
if (*p =3D=3D 0)
return 1;
for (; *s; INCSTR(s))
diff -ur/c:h:s unzip~/unzip.c unzip/unzip.c
--- unzip~/unzip.c 2004-03-01 21:58:05.0 +0000
+++ unzip/unzip.c 2004-03-01 21:58:05.0 +0000
@@ -474,9 +474,6 @@
# ifdef VMSWILD
static ZCONST char Far VmsWild[] =3D "VMSWILD";
# endif
-# ifdef WILD_STOP_AT_DIR
- static ZCONST char Far WildStopAtDir[] =3D "WILD_STOP_AT_DIR";
-# endif
# if CRYPT
# ifdef PASSWD_FROM_STDIN
static ZCONST char Far PasswdStdin[] =3D "PASSWD_FROM_STDIN";
@@ -1442,6 +1439,12 @@
uO.V_flag =3D TRUE;
break;
#endif /* !CMS_MVS */
+ case ('W'): /* Wildcard interpretation (stop at '/'?)=
*/
+ if (negative)
+ uO.W_flag =3D FALSE, negative =3D 0;
+ else
+ uO.W_flag =3D TRUE;
+ break;
case ('x'): /* extract: default */
#ifdef SFX
/* when 'x' is the only option in this argument, and=
the
@@ -1922,11 +1925,6 @@
LoadFarStringSmall(VmsWild)));
++numopts;
#endif
-#ifdef WILD_STOP_AT_DIR
- Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
- LoadFarStringSmall(WildStopAtDir)));
- ++numopts;
-#endif
#if CRYPT
# ifdef PASSWD_FROM_STDIN
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
diff -ur/c:h:s unzip~/zipinfo.c unzip/zipinfo.c
--- unzip~/zipinfo.c 2004-03-01 21:58:05.0 +0000
+++ unzip/zipinfo.c 2004-03-01 21:58:05.0 +0000
@@ -531,6 +531,12 @@
else
uO.lflag =3D 10;
break;
+ case ('W'): /* Wildcard interpretation (stop at '/'?)=
*/
+ if (negative)
+ uO.W_flag =3D FALSE, negative =3D 0;
+ else
+ uO.W_flag =3D TRUE;
+ break;
case 'z': /* print zipfile comment */
if (negative)
uO.zflag =3D negative =3D 0;
Only in unzip: ~bak.c
Only in unzip/c/~rej: match
diff -ur/c:h:s unzip~/unzip.h unzip/unzip.h
--- unzip~/unzip.h 2004-03-01 21:58:07.0 +0000
+++ unzip/unzip.h 2004-03-01 21:58:07.0 +0000
@@ -480,6 +480,7 @@
int uflag; /* -u: "update" (extract only newer/brand-new fi=
les) */
int vflag; /* -v: (verbosely) list directory */
int V_flag; /* -V: don't strip VMS version numbers */
+ int W_flag; /* -W: wildcard '*' won't match '/' */
#if (defined(__BEOS__) || defined(TANDEM) || defined(THEOS) || defined(U=
NIX))
int X_flag; /* -X: restore owner/protection or UID/GID or AC=
Ls */
#else
Only in unzip: ~bak.h
--50242669--1011833074--859453467--