Commit Graph

73 Commits

Author SHA1 Message Date
Ryan C. Gordon 6e7e45cdaf API BREAKAGE: Changed PHYSFS_enumerateFilesCallback() to pass the originally
requested directory back to the app.
2005-09-18 21:44:42 +00:00
Ryan C. Gordon 8f3ab12d22 From: Jorg Walter
To: icculus@clutteredmind.org
Subject: Bug in zip archiver
Date: Sat, 23 Jul 2005 22:19:09 +0200

Hi!

PhysFS has a bug in the ZIP archive module, function zip_find_start_of_dir.
Upon encountering a substring match, rc is set to a wrong value. The fix is
simple: swap both assignments like this:

[patch below  --Ed.]

Some additional info for testing: Symptoms when you encounter this bug: A dir
is reported as empty although it has files in it; prerequisites or
encountering it: two dirs, one a substring of another, like "data/txt" and
"data/txt2", laid out in a way so that variable "middle" points to a file in
txt2 at some point during zip_find_start_of_dir

By the way, if you're interested in where PhysFS is used: I found this bug
while writing a patch for DOSBox (http://dosbox.sourceforge.net) to support
ZIP files. And I'd love to see that enhanced PHYSFS_mount syntax in an
official release soon *hint* ;);)
2005-07-23 21:46:07 +00:00
Ryan C. Gordon d840403c1c All memory management now goes through allocation hooks instead of directly to
C runtime malloc/realloc/free...
2005-03-14 11:49:30 +00:00
Ryan C. Gordon 0492580bda Removed all the forward declaration cruft from the archivers. 2004-09-29 06:18:04 +00:00
Ryan C. Gordon c2765f8571 Added callback APIs and ripped up the internals everywhere to use them. 2004-09-29 06:09:29 +00:00
Ryan C. Gordon 90031c81f3 Did the same thing to FileHandles than I did to DirHandles, but this
triggered massive tweaking in physfs.c. A lot of code got little
cleanups, which was nice. Less malloc pressure, too, since opening a
file used to allocate a ton of crap and mush it together...now it's
basically down to one structure and the instance data in whatever
archiver.
2004-09-26 13:00:59 +00:00
Ryan C. Gordon 94759513d9 Cleaned up archiver interface to not deal with DirHandles anymore,
which simplifies things, removes some responsibility and code
duplication from the archivers, and trims some malloc pressure.
Also ripped up the allocation hook code a little. We'll try to screw
with memory locking later, since it makes everything ugly and
complex. Oh well.
2004-09-26 00:25:04 +00:00
Ryan C. Gordon 7553af8acf Minor allocation hook corrections. 2004-09-23 23:59:17 +00:00
Ryan C. Gordon c0acfc0118 Initial structure for replacable allocator work. 2004-09-23 06:45:36 +00:00
Ryan C. Gordon f3191d0e85 Off-by-one fix by Dieter Baron...fixes segfault in zip archive searching in
certain cases.
2003-07-20 21:13:25 +00:00
Ryan C. Gordon f4309f51e8 Tabs-to-spaces patch by James Turk. 2003-07-20 21:08:24 +00:00
Ryan C. Gordon b50342ad13 PocketPC fixes (thanks, David Hedbor!) 2003-05-18 07:52:28 +00:00
Ryan C. Gordon 1344feceda Fixed seeking in uncompressed zip entries and handle Java-created JAR files.
(Thanks to "Tree" for pointing out these bugs).
2003-03-30 18:44:59 +00:00
Ryan C. Gordon 6f1d693fe8 Another attempt at type size correctness. 2003-03-12 06:19:37 +00:00
Ryan C. Gordon 01505d8d58 Attempt at type correctness. 2003-03-12 05:39:51 +00:00
Ryan C. Gordon 3a479b6cd8 Now compiles on CodeWarrior 6 for MacOS Classic again. 2003-01-31 04:07:48 +00:00
Ryan C. Gordon 9d82110b57 Some cleanups for PocketPC port. 2002-11-22 06:24:10 +00:00
Ryan C. Gordon 7606e3bf11 Win32 fixes. 2002-09-23 18:35:12 +00:00
Ryan C. Gordon ee077eabec Fixed infinite loop bug, cleaned out tab chars. 2002-08-30 14:30:49 +00:00
Ryan C. Gordon f5e279536c Fixed bug that prevented use when symlinks were disallowed.
More optimizations, too.
2002-08-28 23:32:29 +00:00
Ryan C. Gordon 680de768b7 Fixes. 2002-08-28 08:27:27 +00:00
Ryan C. Gordon c5dfea18cf ZIP_exists() now works with directories. 2002-08-21 22:33:30 +00:00
Ryan C. Gordon d40d951594 Minor signed/unsigned fix...ZIP_isDirectory() now seems to work. 2002-08-21 04:13:56 +00:00
Ryan C. Gordon 1f5b571be7 Bunch of tedious corrections, optimizations, and cleanups. 2002-08-21 02:59:15 +00:00
Ryan C. Gordon 1e2372b44c Generalized sorting routines, and removed individual implementations. 2002-08-20 01:34:27 +00:00
Ryan C. Gordon 912ca3266d Fix for correct cleanup on read error. 2002-07-31 04:18:58 +00:00
Ryan C. Gordon d701627335 Patched memory leaks (thanks, Valgrind!) 2002-07-29 06:18:58 +00:00
Ryan C. Gordon 42be0046aa Natural language #defines and build system support. 2002-07-28 21:03:27 +00:00
Ryan C. Gordon 0ab061308d Initialized some variables to stop compiler whining. 2002-07-27 22:06:25 +00:00
Ryan C. Gordon 1b29c3888c More enumerate fixes. 2002-07-26 17:03:26 +00:00
Ryan C. Gordon 3ae1f1fa80 Changed DirFunctions struct a little. 2002-07-26 06:19:09 +00:00
Ryan C. Gordon 8eeaf6c6d7 Rewrote ZIP_enumerateFiles() again. Hopefully it sucks less this time. 2002-07-25 04:41:43 +00:00
Ryan C. Gordon 7c80bcf537 Disabled shitty enumeration code. Will fix soon. 2002-07-23 22:55:47 +00:00
Ryan C. Gordon a4d07b8e10 More enumeration fixes. I still hate this code. 2002-07-23 22:09:35 +00:00
Ryan C. Gordon 55b7638892 Fixed a double-free. 2002-07-23 21:26:51 +00:00
Ryan C. Gordon e460c9ce9a Fixed ZIP_isArchive() to report correctly if it has to check for the
end of central directory record.
2002-07-23 18:05:50 +00:00
Ryan C. Gordon 4765a364fe Fixed enumerations that end with '/'. 2002-07-23 17:52:56 +00:00
Ryan C. Gordon e98615a7ca My rewrite continues. I'm mostly satisfied with this code now, minus debugging. 2002-07-23 07:49:13 +00:00
Ryan C. Gordon f558dcfe4a Seeking backwards in ZIP_seek() works now. 2002-07-17 16:05:39 +00:00
Ryan C. Gordon 2fab3d9da4 Fixed symlink detection. 2002-07-15 13:20:34 +00:00
Ryan C. Gordon 2ec465ffc4 Symlink fixes. Still broken, though. 2002-07-15 02:22:52 +00:00
Ryan C. Gordon 480a259452 ZIP archiver rewrite. 2002-07-13 10:17:13 +00:00
Ryan C. Gordon 959a15e27f FIXME cleanups. 2002-07-11 21:37:30 +00:00
Ryan C. Gordon 05b565422a Implemeted getLastModTime method. 2002-06-06 05:38:47 +00:00
Ryan C. Gordon 5386a5c6a2 Added PHYSFS_getLastModTime() API. (Thanks, John Hall!) 2002-05-25 09:41:14 +00:00
Ryan C. Gordon a2bec46a6b Initial autoconf support. 2002-05-10 09:25:25 +00:00
Ryan C. Gordon 748cbac1c0 Patches for correctness and cleaner win32 support. 2002-04-12 05:53:12 +00:00
Ryan C. Gordon a366cfe1a2 Approved zeph's comments, fixed a few of my screwups. 2002-04-03 07:40:27 +00:00
Gregory S. Read 0217b7cdd7 -Added type casting that Ryan needs to approve.
-MSVC complained about implicit 64-bit to 32-bit conversions.
2002-04-03 04:20:07 +00:00
Ryan C. Gordon 9982d89b5b Removed now-unnecessary errno.h include. 2002-04-01 18:45:37 +00:00