unzip/unzip-5.52-filename_too_long.patch

32 lines
1.2 KiB
Diff

Index: process.c
===================================================================
--- process.c.orig 2009-03-06 02:25:10.000000000 +0100
+++ process.c 2010-05-21 13:17:28.292590863 +0200
@@ -203,6 +203,8 @@ static ZCONST char Far Cent64EndSigSearc
#endif
static ZCONST char Far ZipfileCommTrunc1[] =
"\ncaution: zipfile comment truncated\n";
+static ZCONST char Far FileNameTooLong[] =
+ "%s: error: %s (truncated): %s\n";
#ifndef NO_ZIPINFO
static ZCONST char Far NoZipfileComment[] =
"There is no zipfile comment.\n";
@@ -390,6 +392,17 @@ int process_zipfiles(__G) /* return P
lastzipfn = G.zipfn;
+ if (strlen(G.wildzipfn) > strlen(G.zipfn))
+ {
+ Info(slide, 1, ((char *)slide,
+ LoadFarString(FileNameTooLong),
+ uO.zipinfo_mode? LoadFarStringSmall(Zipnfo) : LoadFarStringSmall(Unzip),
+ G.zipfn, strerror(ENAMETOOLONG)));
+
+ free_G_buffers(__G);
+ return PK_NOZIP;
+ }
+
/* print a blank line between the output of different zipfiles */
if (!uO.qflag && error != PK_NOZIP && error != IZ_DIR
#ifdef TIMESTAMP