* lib/zip_name_locate.c (_zip_name_locate): fix ZIP_FL_NODIR; also follow appnote.txt and only accept forward slashes as directory separators. --HG-- branch : HEAD
diff --git a/ChangeLog b/ChangeLog index 4b64adc..a6886cf 100644 --- a/ChangeLog +++ b/ChangeLog
@@ -1,3 +1,9 @@ +2005-01-11 Thomas Klausner <wiz@danbala.tuwien.ac.at> + + * lib/zip_name_locate.c (_zip_name_locate): fix ZIP_FL_NODIR; + also follow appnote.txt and only accept forward slashes as + directory separators. + 2005-01-11 Dieter Baron <dillo@danbala.tuwien.ac.at> * lib/zip_new.c (_zip_new): init error.
diff --git a/lib/zip_name_locate.c b/lib/zip_name_locate.c index 006d17e..9f5ffdb 100644 --- a/lib/zip_name_locate.c +++ b/lib/zip_name_locate.c
@@ -1,5 +1,5 @@ /* - $NiH: zip_name_locate.c,v 1.16 2004/11/30 22:19:37 wiz Exp $ + $NiH: zip_name_locate.c,v 1.17 2004/11/30 23:02:47 wiz Exp $ zip_name_locate.c -- get index by name Copyright (C) 1999, 2003, 2004 Dieter Baron and Thomas Klausner @@ -55,7 +55,7 @@ struct zip_error *error) { int (*cmp)(const char *, const char *); - const char *fn, *p, *q; + const char *fn, *p; int i, n; if (fname == NULL) { @@ -77,15 +77,9 @@ continue; if (flags & ZIP_FL_NODIR) { - /* XXX: is this correct? */ p = strrchr(fn, '/'); - q = strrchr(fn, '\\'); - if (p && q) - fn = (p > q) ? p : q; - else if (p) - fn = p; - else if (q) - fn = q; + if (p) + fn = p+1; } if (cmp(fname, fn) == 0)