Hello community, here is the log from the commit of package physfs for openSUSE:Factory checked in at 2013-11-29 16:25:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/physfs (Old) and /work/SRC/openSUSE:Factory/.physfs.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "physfs" Changes: -------- --- /work/SRC/openSUSE:Factory/physfs/physfs.changes 2012-03-06 13:41:19.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.physfs.new/physfs.changes 2013-11-29 16:25:32.000000000 +0100 @@ -1,0 +2,18 @@ +Tue Nov 26 17:22:01 UTC 2013 - [email protected] + +- Remove physfs-2.0.2-gcc46.patch (merged upstream) + +------------------------------------------------------------------- +Fri Nov 15 20:04:27 UTC 2013 - [email protected] + +- Source code now packaged in a .tar.bz2 instead of .tar.gz. +- Fixed "make docs" for out-of-tree builds. +- No longer builds annoying wxWidgets test program by default. +- Fixed logic bug in UTF-8 string processing. +- Fixed infinite loop on some .zip files with symlinks. +- Fixed building of readline support in test program. +- Fixed .zip archiver losing files in some cases. +- Corrected copyright dates in license. +- Other minor tweaks and fixes. + +------------------------------------------------------------------- Old: ---- physfs-2.0.2-gcc46.patch physfs-2.0.2.tar.gz New: ---- physfs-2.0.3.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ physfs.spec ++++++ --- /var/tmp/diff_new_pack.iBPvcc/_old 2013-11-29 16:25:32.000000000 +0100 +++ /var/tmp/diff_new_pack.iBPvcc/_new 2013-11-29 16:25:32.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package physfs # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,40 +17,39 @@ %define so_nr 1 +%define desc "PhysicsFS is a library to provide abstract access to various archives.\ +It is intended for use in video games, and the design was somewhat\ +inspired by Quake 3's file subsystem. The programmer defines a "write\ +directory" on the physical filesystem. No file writing done through the\ +PhysicsFS API can leave that write directory, for security. For\ +example, an embedded scripting language cannot write outside of this\ +path if it uses PhysFS for all of its I/O, which means that untrusted\ +scripts can run more safely. Symbolic links can be disabled as well,\ +for added safety. For file reading, the programmer lists directories\ +and archives that form a "search path". Once the search path is\ +defined, it becomes a single, transparent hierarchical filesystem. This\ +makes for easy access to ZIP files in the same way as you access a file\ +directly on the disk, and it makes it easy to ship a new archive that\ +will override a previous archive on a per-file basis. Finally,\ +PhysicsFS gives you platform-abstracted means to determine if CD-ROMs\ +are available, the user's home directory, where in the real filesystem\ +your program is running, etc."\ Name: physfs -Version: 2.0.2 +Version: 2.0.3 Release: 0 Summary: PhysicsFS file abstraction layer for games License: (LGPL-2.1+ or CPL-1.0) and Zlib Group: System/Libraries Url: http://www.icculus.org/physfs/ -Source0: http://icculus.org/physfs/downloads/%{name}-%{version}.tar.gz -# PATCH-FIX-UPSTREAM %{name}-2.0.2-gcc46.patch [email protected] -- Fixes gcc 4.6 compilation. From upstream trunk. -Patch0: %{name}-2.0.2-gcc46.patch +Source: http://icculus.org/physfs/downloads/%{name}-%{version}.tar.bz2 BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: zlib-devel BuildRoot: %{_tmppath}/%{name}-%{version}-build %description -PhysicsFS is a library to provide abstract access to various archives. -It is intended for use in video games, and the design was somewhat -inspired by Quake 3's file subsystem. The programmer defines a "write -directory" on the physical filesystem. No file writing done through the -PhysicsFS API can leave that write directory, for security. For -example, an embedded scripting language cannot write outside of this -path if it uses PhysFS for all of its I/O, which means that untrusted -scripts can run more safely. Symbolic links can be disabled as well, -for added safety. For file reading, the programmer lists directories -and archives that form a "search path". Once the search path is -defined, it becomes a single, transparent hierarchical filesystem. This -makes for easy access to ZIP files in the same way as you access a file -directly on the disk, and it makes it easy to ship a new archive that -will override a previous archive on a per-file basis. Finally, -PhysicsFS gives you platform-abstracted means to determine if CD-ROMs -are available, the user's home directory, where in the real filesystem -your program is running, etc. +%{desc} %package -n lib%{name}%{so_nr} Summary: PhysicsFS file abstraction layer for games @@ -60,23 +59,7 @@ Obsoletes: physfs <= 1.0.1 %description -n lib%{name}%{so_nr} -PhysicsFS is a library to provide abstract access to various archives. -It is intended for use in video games, and the design was somewhat -inspired by Quake 3's file subsystem. The programmer defines a "write -directory" on the physical filesystem. No file writing done through the -PhysicsFS API can leave that write directory, for security. For -example, an embedded scripting language cannot write outside of this -path if it uses PhysFS for all of its I/O, which means that untrusted -scripts can run more safely. Symbolic links can be disabled as well, -for added safety. For file reading, the programmer lists directories -and archives that form a "search path". Once the search path is -defined, it becomes a single, transparent hierarchical filesystem. This -makes for easy access to ZIP files in the same way as you access a file -directly on the disk, and it makes it easy to ship a new archive that -will override a previous archive on a per-file basis. Finally, -PhysicsFS gives you platform-abstracted means to determine if CD-ROMs -are available, the user's home directory, where in the real filesystem -your program is running, etc. +%{desc} %package -n lib%{name}-devel Summary: Libraries, includes and more to develop PhysicsFS applications @@ -87,27 +70,10 @@ Obsoletes: physfs-devel <= 1.0.1 %description -n lib%{name}-devel -PhysicsFS is a library to provide abstract access to various archives. -It is intended for use in video games, and the design was somewhat -inspired by Quake 3's file subsystem. The programmer defines a "write -directory" on the physical filesystem. No file writing done through the -PhysicsFS API can leave that write directory, for security. For -example, an embedded scripting language cannot write outside of this -path if it uses PhysFS for all of its I/O, which means that untrusted -scripts can run more safely. Symbolic links can be disabled as well, -for added safety. For file reading, the programmer lists directories -and archives that form a "search path". Once the search path is -defined, it becomes a single, transparent hierarchical filesystem. This -makes for easy access to ZIP files in the same way as you access a file -directly on the disk, and it makes it easy to ship a new archive that -will override a previous archive on a per-file basis. Finally, -PhysicsFS gives you platform-abstracted means to determine if CD-ROMs -are available, the user's home directory, where in the real filesystem -your program is running, etc. +%{desc} %prep %setup -q -%patch0 %build # just to be sure... @@ -128,9 +94,6 @@ cd build make DESTDIR=$RPM_BUILD_ROOT install -%clean -rm -rf %{buildroot} - %post -n lib%{name}%{so_nr} -p /sbin/ldconfig %postun -n lib%{name}%{so_nr} -p /sbin/ldconfig ++++++ physfs-2.0.2.tar.gz -> physfs-2.0.3.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/.hg_archival.txt new/physfs-2.0.3/.hg_archival.txt --- old/physfs-2.0.2/.hg_archival.txt 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/.hg_archival.txt 2012-10-23 05:41:04.000000000 +0200 @@ -1,5 +1,5 @@ repo: 7672c9962ce627edaaa67ff54fe4ad8f9a46dc2b -node: 92a35b8603186c536e4cc126458dfc2d2809b19c +node: f94eec5e90540889a42c34a27931b8266f4af52c branch: stable-2.0 -latesttag: release-2.0.2 +latesttag: release-2.0.3 latesttagdistance: 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/.hgtags new/physfs-2.0.3/.hgtags --- old/physfs-2.0.2/.hgtags 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/.hgtags 2012-10-23 05:41:04.000000000 +0200 @@ -14,3 +14,4 @@ df04959950eb3830c39adfa983789f70f86062d7 release-1.1.0 94771621792f838aa4cacf9a1e1f4f86c1cb0711 release-2.0.1 236afd18dd8cae34adb9897024bdcecc1dc8ca5d release-2.0.2 +bf155bd2127befa399105194e13737d7c3496be0 release-2.0.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/CMakeLists.txt new/physfs-2.0.3/CMakeLists.txt --- old/physfs-2.0.2/CMakeLists.txt 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/CMakeLists.txt 2012-10-23 05:41:04.000000000 +0200 @@ -6,7 +6,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.4) PROJECT(PhysicsFS) -SET(PHYSFS_VERSION 2.0.2) +SET(PHYSFS_VERSION 2.0.3) # Increment this if/when we break backwards compatibility. SET(PHYSFS_SOVERSION 1) @@ -21,6 +21,11 @@ SET(MACOSX TRUE) ENDIF(APPLE AND NOT MACOSX) +# For now, Haiku and BeOS are the same, as far as the build system cares. +IF(HAIKU AND NOT BEOS) + SET(BEOS TRUE) +ENDIF(HAIKU AND NOT BEOS) + INCLUDE(CheckIncludeFile) INCLUDE(CheckLibraryExists) INCLUDE(CheckCSourceCompiles) @@ -303,20 +308,19 @@ FIND_LIBRARY(CURSES_LIBRARY NAMES curses ncurses) SET(CMAKE_REQUIRED_LIBRARIES ${CURSES_LIBRARY}) FIND_LIBRARY(READLINE_LIBRARY readline) - FIND_LIBRARY(HISTORY_LIBRARY history) - IF(READLINE_LIBRARY AND HISTORY_LIBRARY) + IF(READLINE_LIBRARY) SET(HAVE_SYSTEM_READLINE TRUE) SET(TEST_PHYSFS_LIBS ${TEST_PHYSFS_LIBS} ${READLINE_LIBRARY} ${CURSES_LIBRARY}) INCLUDE_DIRECTORIES(${READLINE_H} ${HISTORY_H}) ADD_DEFINITIONS(-DPHYSFS_HAVE_READLINE=1) - ENDIF(READLINE_LIBRARY AND HISTORY_LIBRARY) + ENDIF(READLINE_LIBRARY) ENDIF(READLINE_H AND HISTORY_H) ADD_EXECUTABLE(test_physfs test/test_physfs.c) TARGET_LINK_LIBRARIES(test_physfs ${PHYSFS_LIB_TARGET} ${TEST_PHYSFS_LIBS} ${OTHER_LDFLAGS}) SET(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";test_physfs") ENDIF(PHYSFS_BUILD_TEST) -OPTION(PHYSFS_BUILD_WX_TEST "Build wxWidgets test program." TRUE) +OPTION(PHYSFS_BUILD_WX_TEST "Build wxWidgets test program." FALSE) MARK_AS_ADVANCED(PHYSFS_BUILD_WX_TEST) IF(PHYSFS_BUILD_WX_TEST) SET(wxWidgets_USE_LIBS base core adv) @@ -342,16 +346,32 @@ FIND_PACKAGE(Doxygen) IF(DOXYGEN_FOUND) - ADD_CUSTOM_TARGET(docs ${DOXYGEN_EXECUTABLE} COMMENT "Building documentation") + SET(PHYSFS_OUTPUT_DOXYFILE "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile") + CONFIGURE_FILE( + "${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile" + "${PHYSFS_OUTPUT_DOXYFILE}" + COPYONLY + ) + FILE(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "\n\n# Below auto-generated by cmake...\n\n") + FILE(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "PROJECT_NUMBER = ${PHYSFS_VERSION}\n") + FILE(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "OUTPUT_DIRECTORY = ${CMAKE_CURRENT_BINARY_DIR}/docs\n") + FILE(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "\n# End auto-generated section.\n\n") + + ADD_CUSTOM_TARGET( + docs + ${DOXYGEN_EXECUTABLE} "${PHYSFS_OUTPUT_DOXYFILE}" + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + COMMENT "Building documentation in 'docs' directory..." + ) ELSE(DOXYGEN_FOUND) MESSAGE(STATUS "Doxygen not found. You won't be able to build documentation.") ENDIF(DOXYGEN_FOUND) IF(UNIX) - SET(PHYSFS_TARBALL "${CMAKE_CURRENT_SOURCE_DIR}/../physfs-${PHYSFS_VERSION}.tar.gz") + SET(PHYSFS_TARBALL "${CMAKE_CURRENT_SOURCE_DIR}/../physfs-${PHYSFS_VERSION}.tar.bz2") ADD_CUSTOM_TARGET( dist - hg archive -t tgz "${PHYSFS_TARBALL}" + hg archive -t tbz2 "${PHYSFS_TARBALL}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" COMMENT "Building source tarball '${PHYSFS_TARBALL}'..." ) @@ -385,4 +405,3 @@ ENDIF(PHYSFS_BUILD_TEST) # end of CMakeLists.txt ... - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/CREDITS.txt new/physfs-2.0.3/CREDITS.txt --- old/physfs-2.0.2/CREDITS.txt 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/CREDITS.txt 2012-10-23 05:41:04.000000000 +0200 @@ -106,6 +106,9 @@ Bug fixes: Patrice Mandin +Bug fixes: + Lauri Kasanen + Other stuff: Your name here! Patches go to [email protected] ... diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/Doxyfile new/physfs-2.0.3/Doxyfile --- old/physfs-2.0.2/Doxyfile 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/Doxyfile 2012-10-23 05:41:04.000000000 +0200 @@ -22,8 +22,8 @@ # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. - -PROJECT_NUMBER = 2.0.2 +# (CMake will set this properly at build time. --ryan.) +PROJECT_NUMBER = "unknown version (build with 'make docs' next time!)" # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/LICENSE.txt new/physfs-2.0.3/LICENSE.txt --- old/physfs-2.0.2/LICENSE.txt 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/LICENSE.txt 2012-10-23 05:41:04.000000000 +0200 @@ -1,5 +1,5 @@ - Copyright (c) 2001-2011 Ryan C. Gordon and others. + Copyright (c) 2001-2012 Ryan C. Gordon and others. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/archivers/wad.c new/physfs-2.0.3/archivers/wad.c --- old/physfs-2.0.2/archivers/wad.c 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/archivers/wad.c 2012-10-23 05:41:04.000000000 +0200 @@ -245,9 +245,6 @@ PHYSFS_uint32 fileCount; PHYSFS_uint32 directoryOffset; WADentry *entry; - char lastDirectory[9]; - - lastDirectory[8] = 0; /* Make sure lastDirectory stays null-terminated. */ BAIL_IF_MACRO(!wad_open(name, forWriting, &fh, &fileCount,&directoryOffset), NULL, 0); info->entryCount = fileCount; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/archivers/zip.c new/physfs-2.0.3/archivers/zip.c --- old/physfs-2.0.2/archivers/zip.c 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/archivers/zip.c 2012-10-23 05:41:04.000000000 +0200 @@ -535,6 +535,8 @@ else /* substring match...might be dir or entry or nothing. */ { + int i; + if (isDir != NULL) { *isDir = (thispath[pathlen] == '/'); @@ -544,12 +546,27 @@ if (thispath[pathlen] == '\0') /* found entry? */ return(&a[middle]); - /* adjust search params, try again. */ - else if (thispath[pathlen] > '/') - hi = middle - 1; - else - lo = middle + 1; - } /* if */ + + /* substring match; search remaining space to find it... */ + for (i = lo; i < hi; i++) + { + thispath = a[i].name; + if (strncmp(path, thispath, pathlen) == 0) + { + if (isDir != NULL) + { + *isDir = (thispath[pathlen] == '/'); + if (*isDir) + return(NULL); + } /* if */ + + if (thispath[pathlen] == '\0') /* found entry? */ + return(&a[i]); + } /* if */ + } /* for */ + break; + + } /* else */ } /* while */ if (isDir != NULL) @@ -628,6 +645,7 @@ else { prevptr = ptr; + ptr++; } /* else */ } /* while */ } /* zip_expand_symlink_path */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/extras/globbing.h new/physfs-2.0.3/extras/globbing.h --- old/physfs-2.0.2/extras/globbing.h 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/extras/globbing.h 2012-10-23 05:41:04.000000000 +0200 @@ -1,3 +1,6 @@ +#ifndef INCL_PHYSFSEXT_GLOBBING_H +#define INCL_PHYSFSEXT_GLOBBING_H + /** \file globbing.h */ /** @@ -30,6 +33,9 @@ * \author Ryan C. Gordon. */ +#ifdef __cplusplus +extern "C" { +#endif /** * \fn char **PHYSFS_enumerateFilesWildcard(const char *dir, const char *wildcard, int caseSensitive) @@ -73,5 +79,11 @@ const char *wildcard, int caseSensitive); +#ifdef __cplusplus +} +#endif + +#endif /* include-once blocker. */ + /* end of globbing.h ... */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/extras/ignorecase.c new/physfs-2.0.3/extras/ignorecase.c --- old/physfs-2.0.2/extras/ignorecase.c 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/extras/ignorecase.c 2012-10-23 05:41:04.000000000 +0200 @@ -98,7 +98,7 @@ if (*ptr == '\0') return(0); /* Uh...I guess that's success. */ - while (ptr = strchr(ptr + 1, '/')) + while ( (ptr = strchr(ptr + 1, '/')) != NULL ) { *ptr = '\0'; /* block this path section off */ rc = locateOneElement(buf); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/extras/ignorecase.h new/physfs-2.0.3/extras/ignorecase.h --- old/physfs-2.0.2/extras/ignorecase.h 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/extras/ignorecase.h 2012-10-23 05:41:04.000000000 +0200 @@ -1,3 +1,6 @@ +#ifndef INCL_PHYSFSEXT_IGNORECASE_H +#define INCL_PHYSFSEXT_IGNORECASE_H + /** \file ignorecase.h */ /** @@ -44,6 +47,9 @@ * \author Ryan C. Gordon. */ +#ifdef __cplusplus +extern "C" { +#endif /** * \fn int PHYSFSEXT_locateCorrectCase(char *buf) @@ -71,5 +77,11 @@ */ int PHYSFSEXT_locateCorrectCase(char *buf); +#ifdef __cplusplus +} +#endif + +#endif /* include-once blocker. */ + /* end of ignorecase.h ... */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/physfs.c new/physfs-2.0.3/physfs.c --- old/physfs-2.0.2/physfs.c 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/physfs.c 2012-10-23 05:41:04.000000000 +0200 @@ -43,7 +43,7 @@ typedef struct __PHYSFS_ERRMSGTYPE__ { - PHYSFS_uint64 tid; + void *tid; int errorAvailable; char errorString[80]; struct __PHYSFS_ERRMSGTYPE__ *next; @@ -94,7 +94,7 @@ NULL }; -static const PHYSFS_Archiver *archivers[] = +static const PHYSFS_Archiver * const archivers[] = { &__PHYSFS_Archiver_DIR, #if (defined PHYSFS_SUPPORTS_ZIP) @@ -261,14 +261,15 @@ * Quicksort w/ Bubblesort fallback algorithm inspired by code from here: * http://www.cs.ubc.ca/spider/harrison/Java/sorting-demo.html */ - __PHYSFS_quick_sort(entries, 0, max - 1, cmpfn, swapfn); + if (max > 0) + __PHYSFS_quick_sort(entries, 0, max - 1, cmpfn, swapfn); } /* __PHYSFS_sort */ static ErrMsg *findErrorForCurrentThread(void) { ErrMsg *i; - PHYSFS_uint64 tid; + void *tid; if (errorLock != NULL) __PHYSFS_platformGrabMutex(errorLock); @@ -416,7 +417,7 @@ static DirHandle *openDirectory(const char *d, int forWriting) { DirHandle *retval = NULL; - const PHYSFS_Archiver **i; + const PHYSFS_Archiver * const *i; const char *ext; BAIL_IF_MACRO(!__PHYSFS_platformExists(d), ERR_NO_SUCH_FILE, NULL); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/physfs.h new/physfs-2.0.3/physfs.h --- old/physfs-2.0.2/physfs.h 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/physfs.h 2012-10-23 05:41:04.000000000 +0200 @@ -405,7 +405,7 @@ #ifndef DOXYGEN_SHOULD_IGNORE_THIS #define PHYSFS_VER_MAJOR 2 #define PHYSFS_VER_MINOR 0 -#define PHYSFS_VER_PATCH 2 +#define PHYSFS_VER_PATCH 3 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/physfs_internal.h new/physfs-2.0.3/physfs_internal.h --- old/physfs-2.0.2/physfs_internal.h 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/physfs_internal.h 2012-10-23 05:41:04.000000000 +0200 @@ -970,7 +970,8 @@ #define PHYSFS_LIL_ENDIAN 1234 #define PHYSFS_BIG_ENDIAN 4321 -#if defined(__i386__) || defined(__ia64__) || defined(_M_IX86) || defined(_M_IA64) || \ +#if defined(__i386__) || defined(__ia64__) || \ + defined(_M_IX86) || defined(_M_IA64) || defined(_M_X64) || \ (defined(__alpha__) || defined(__alpha)) || \ defined(__arm__) || defined(ARM) || \ (defined(__mips__) && defined(__MIPSEL__)) || \ @@ -1225,8 +1226,7 @@ * * Not all file types can "tell"; this is to be expected by the caller. * - * On error, call __PHYSFS_setError() and return zero. On success, return - * a non-zero value. + * On error, call __PHYSFS_setError() and return -1. On success, return >= 0. */ PHYSFS_sint64 __PHYSFS_platformTell(void *opaque); @@ -1305,12 +1305,12 @@ char *__PHYSFS_platformGetUserDir(void); /* - * Return a number that uniquely identifies the current thread. - * On a platform without threading, (1) will suffice. These numbers are + * Return a pointer that uniquely identifies the current thread. + * On a platform without threading, (0x1) will suffice. These numbers are * arbitrary; the only requirement is that no two threads have the same - * number. + * pointer. */ -PHYSFS_uint64 __PHYSFS_platformGetThreadID(void); +void *__PHYSFS_platformGetThreadID(void); /* * Return non-zero if filename (in platform-dependent notation) exists. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/physfs_platforms.h new/physfs-2.0.3/physfs_platforms.h --- old/physfs-2.0.2/physfs_platforms.h 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/physfs_platforms.h 2012-10-23 05:41:04.000000000 +0200 @@ -38,7 +38,7 @@ # endif #elif defined(macintosh) # error Classic Mac OS support was dropped from PhysicsFS 2.0. Move to OS X. -#elif defined(unix) +#elif defined(unix) || defined(__unix__) # define PHYSFS_PLATFORM_UNIX # define PHYSFS_PLATFORM_POSIX #else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/physfs_unicode.c new/physfs-2.0.3/physfs_unicode.c --- old/physfs-2.0.2/physfs_unicode.c 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/physfs_unicode.c 2012-10-23 05:41:04.000000000 +0200 @@ -63,12 +63,13 @@ else if (octet < 224) /* two octets */ { + (*_str)++; /* advance at least one byte in case of an error */ octet -= (128+64); octet2 = (PHYSFS_uint32) ((PHYSFS_uint8) *(++str)); if ((octet2 & (128+64)) != 128) /* Format isn't 10xxxxxx? */ return UNICODE_BOGUS_CHAR_VALUE; - *_str += 2; /* skip to next possible start of codepoint. */ + *_str += 1; /* skip to next possible start of codepoint. */ retval = ((octet << 6) | (octet2 - 128)); if ((retval >= 0x80) && (retval <= 0x7FF)) return retval; @@ -76,6 +77,7 @@ else if (octet < 240) /* three octets */ { + (*_str)++; // advance at least one byte in case of an error octet -= (128+64+32); octet2 = (PHYSFS_uint32) ((PHYSFS_uint8) *(++str)); if ((octet2 & (128+64)) != 128) /* Format isn't 10xxxxxx? */ @@ -85,7 +87,7 @@ if ((octet3 & (128+64)) != 128) /* Format isn't 10xxxxxx? */ return UNICODE_BOGUS_CHAR_VALUE; - *_str += 3; /* skip to next possible start of codepoint. */ + *_str += 2; /* skip to next possible start of codepoint. */ retval = ( ((octet << 12)) | ((octet2-128) << 6) | ((octet3-128)) ); /* There are seven "UTF-16 surrogates" that are illegal in UTF-8. */ @@ -108,6 +110,7 @@ else if (octet < 248) /* four octets */ { + (*_str)++; // advance at least one byte in case of an error octet -= (128+64+32+16); octet2 = (PHYSFS_uint32) ((PHYSFS_uint8) *(++str)); if ((octet2 & (128+64)) != 128) /* Format isn't 10xxxxxx? */ @@ -121,7 +124,7 @@ if ((octet4 & (128+64)) != 128) /* Format isn't 10xxxxxx? */ return UNICODE_BOGUS_CHAR_VALUE; - *_str += 4; /* skip to next possible start of codepoint. */ + *_str += 3; /* skip to next possible start of codepoint. */ retval = ( ((octet << 18)) | ((octet2 - 128) << 12) | ((octet3 - 128) << 6) | ((octet4 - 128)) ); if ((retval >= 0x10000) && (retval <= 0x10FFFF)) @@ -136,6 +139,7 @@ else if (octet < 252) /* five octets */ { + (*_str)++; // advance at least one byte in case of an error octet = (PHYSFS_uint32) ((PHYSFS_uint8) *(++str)); if ((octet & (128+64)) != 128) /* Format isn't 10xxxxxx? */ return UNICODE_BOGUS_CHAR_VALUE; @@ -152,12 +156,13 @@ if ((octet & (128+64)) != 128) /* Format isn't 10xxxxxx? */ return UNICODE_BOGUS_CHAR_VALUE; - *_str += 5; /* skip to next possible start of codepoint. */ + *_str += 4; /* skip to next possible start of codepoint. */ return UNICODE_BOGUS_CHAR_VALUE; } /* else if */ else /* six octets */ { + (*_str)++; // advance at least one byte in case of an error octet = (PHYSFS_uint32) ((PHYSFS_uint8) *(++str)); if ((octet & (128+64)) != 128) /* Format isn't 10xxxxxx? */ return UNICODE_BOGUS_CHAR_VALUE; @@ -178,7 +183,7 @@ if ((octet & (128+64)) != 128) /* Format isn't 10xxxxxx? */ return UNICODE_BOGUS_CHAR_VALUE; - *_str += 6; /* skip to next possible start of codepoint. */ + *_str += 5; /* skip to next possible start of codepoint. */ return UNICODE_BOGUS_CHAR_VALUE; } /* else if */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/platform/beos.cpp new/physfs-2.0.3/platform/beos.cpp --- old/physfs-2.0.2/platform/beos.cpp 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/platform/beos.cpp 2012-10-23 05:41:04.000000000 +0200 @@ -197,9 +197,9 @@ } /* __PHYSFS_platformCalcBaseDir */ -PHYSFS_uint64 __PHYSFS_platformGetThreadID(void) +void *__PHYSFS_platformGetThreadID(void) { - return((PHYSFS_uint64) find_thread(NULL)); + return((void *) find_thread(NULL)); } /* __PHYSFS_platformGetThreadID */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/platform/macosx.c new/physfs-2.0.3/platform/macosx.c --- old/physfs-2.0.2/platform/macosx.c 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/platform/macosx.c 2012-10-23 05:41:04.000000000 +0200 @@ -16,6 +16,7 @@ #include <IOKit/storage/IOCDMedia.h> #include <IOKit/storage/IODVDMedia.h> #include <sys/mount.h> +#include <sys/stat.h> /* Seems to get defined in some system header... */ #ifdef Free @@ -219,12 +220,15 @@ char *__PHYSFS_platformCalcBaseDir(const char *argv0) { ProcessSerialNumber psn = { 0, kCurrentProcess }; + struct stat statbuf; FSRef fsref; CFRange cfrange; CFURLRef cfurl = NULL; CFStringRef cfstr = NULL; CFMutableStringRef cfmutstr = NULL; char *retval = NULL; + char *cstr = NULL; + int rc = 0; BAIL_IF_MACRO(GetProcessBundleLocation(&psn, &fsref) != noErr, NULL, NULL); cfurl = CFURLCreateFromFSRef(cfallocator, &fsref); @@ -236,27 +240,46 @@ CFRelease(cfstr); BAIL_IF_MACRO(cfmutstr == NULL, NULL, NULL); - /* Find last dirsep so we can chop the binary's filename from the path. */ - cfrange = CFStringFind(cfmutstr, CFSTR("/"), kCFCompareBackwards); - if (cfrange.location == kCFNotFound) + /* we have to decide if we got a binary's path, or the .app dir... */ + cstr = convertCFString(cfmutstr); + if (cstr == NULL) { - assert(0); /* shouldn't ever hit this... */ CFRelease(cfmutstr); return(NULL); } /* if */ - /* chop the "/exename" from the end of the path string... */ - cfrange.length = CFStringGetLength(cfmutstr) - cfrange.location; - CFStringDelete(cfmutstr, cfrange); - - /* If we're an Application Bundle, chop everything but the base. */ - cfrange = CFStringFind(cfmutstr, CFSTR("/Contents/MacOS"), - kCFCompareCaseInsensitive | - kCFCompareBackwards | - kCFCompareAnchored); + rc = stat(cstr, &statbuf); + allocator.Free(cstr); /* done with this. */ + if (rc == -1) + { + CFRelease(cfmutstr); + return(NULL); /* maybe default behaviour will work? */ + } /* if */ - if (cfrange.location != kCFNotFound) - CFStringDelete(cfmutstr, cfrange); /* chop that, too. */ + if (S_ISREG(statbuf.st_mode)) + { + /* Find last dirsep so we can chop the filename from the path. */ + cfrange = CFStringFind(cfmutstr, CFSTR("/"), kCFCompareBackwards); + if (cfrange.location == kCFNotFound) + { + assert(0); /* shouldn't ever hit this... */ + CFRelease(cfmutstr); + return(NULL); + } /* if */ + + /* chop the "/exename" from the end of the path string... */ + cfrange.length = CFStringGetLength(cfmutstr) - cfrange.location; + CFStringDelete(cfmutstr, cfrange); + + /* If we're an Application Bundle, chop everything but the base. */ + cfrange = CFStringFind(cfmutstr, CFSTR("/Contents/MacOS"), + kCFCompareCaseInsensitive | + kCFCompareBackwards | + kCFCompareAnchored); + + if (cfrange.location != kCFNotFound) + CFStringDelete(cfmutstr, cfrange); /* chop that, too. */ + } /* if */ retval = convertCFString(cfmutstr); CFRelease(cfmutstr); @@ -353,9 +376,9 @@ } /* __PHYSFS_platformSetDefaultAllocator */ -PHYSFS_uint64 __PHYSFS_platformGetThreadID(void) +void *__PHYSFS_platformGetThreadID(void) { - return( (PHYSFS_uint64) ((size_t) MPCurrentTaskID()) ); + return( (void *) ((size_t) MPCurrentTaskID()) ); } /* __PHYSFS_platformGetThreadID */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/platform/os2.c new/physfs-2.0.3/platform/os2.c --- old/physfs-2.0.2/platform/os2.c 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/platform/os2.c 2012-10-23 05:41:04.000000000 +0200 @@ -649,7 +649,7 @@ } /* __PHYSFS_platformGetLastModTime */ -PHYSFS_uint64 __PHYSFS_platformGetThreadID(void) +void *__PHYSFS_platformGetThreadID(void) { PTIB ptib; PPIB ppib; @@ -659,7 +659,7 @@ * default value (zero might as well do) if it does. */ BAIL_IF_MACRO(os2err(DosGetInfoBlocks(&ptib, &ppib)) != NO_ERROR, 0, 0); - return((PHYSFS_uint64) ptib->tib_ordinal); + return((void *) ptib->tib_ordinal); } /* __PHYSFS_platformGetThreadID */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/platform/pocketpc.c new/physfs-2.0.3/platform/pocketpc.c --- old/physfs-2.0.2/platform/pocketpc.c 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/platform/pocketpc.c 2012-10-23 05:41:04.000000000 +0200 @@ -161,9 +161,9 @@ } /* __PHYSFS_platformGetUserDir */ -PHYSFS_uint64 __PHYSFS_platformGetThreadID(void) +void *__PHYSFS_platformGetThreadID(void) { - return(1); /* single threaded. */ + return((void *)1); /* single threaded. */ } /* __PHYSFS_platformGetThreadID */ @@ -467,7 +467,7 @@ LowPos = SetFilePointer(Handle, 0, &HighPos, FILE_CURRENT); if ((LowPos == INVALID_SET_FILE_POINTER) && (GetLastError() != NO_ERROR)) { - BAIL_MACRO(win32strerror(), 0); + BAIL_MACRO(win32strerror(), -1); } /* if */ else { @@ -505,14 +505,18 @@ int __PHYSFS_platformEOF(void *opaque) { + const PHYSFS_sint64 FileLength = __PHYSFS_platformFileLength(opaque); PHYSFS_sint64 FilePosition; int retval = 0; + if (FileLength == 0) + return 1; /* we're definitely at EOF. */ + /* Get the current position in the file */ - if ((FilePosition = __PHYSFS_platformTell(opaque)) != 0) + if ((FilePosition = __PHYSFS_platformTell(opaque)) != -1) { /* Non-zero if EOF is equal to the file length */ - retval = FilePosition == __PHYSFS_platformFileLength(opaque); + retval = (FilePosition == FileLength); } /* if */ return(retval); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/platform/posix.c new/physfs-2.0.3/platform/posix.c --- old/physfs-2.0.2/platform/posix.c 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/platform/posix.c 2012-10-23 05:41:04.000000000 +0200 @@ -383,7 +383,7 @@ { PHYSFS_sint64 pos = __PHYSFS_platformTell(opaque); PHYSFS_sint64 len = __PHYSFS_platformFileLength(opaque); - return(pos >= len); + return((pos < 0) || (len < 0) || (pos >= len)); } /* __PHYSFS_platformEOF */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/platform/unix.c new/physfs-2.0.3/platform/unix.c --- old/physfs-2.0.2/platform/unix.c 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/platform/unix.c 2012-10-23 05:41:04.000000000 +0200 @@ -342,7 +342,7 @@ #if (defined PHYSFS_NO_THREAD_SUPPORT) -PHYSFS_uint64 __PHYSFS_platformGetThreadID(void) { return(0x0001); } +void *__PHYSFS_platformGetThreadID(void) { return((void *) 0x0001); } void *__PHYSFS_platformCreateMutex(void) { return((void *) 0x0001); } void __PHYSFS_platformDestroyMutex(void *mutex) {} int __PHYSFS_platformGrabMutex(void *mutex) { return(1); } @@ -357,24 +357,9 @@ PHYSFS_uint32 count; } PthreadMutex; -/* Just in case; this is a panic value. */ -#if ((!defined SIZEOF_INT) || (SIZEOF_INT <= 0)) -# define SIZEOF_INT 4 -#endif - -#if (SIZEOF_INT == 4) -# define PHTREAD_TO_UI64(thr) ( (PHYSFS_uint64) ((PHYSFS_uint32) (thr)) ) -#elif (SIZEOF_INT == 2) -# define PHTREAD_TO_UI64(thr) ( (PHYSFS_uint64) ((PHYSFS_uint16) (thr)) ) -#elif (SIZEOF_INT == 1) -# define PHTREAD_TO_UI64(thr) ( (PHYSFS_uint64) ((PHYSFS_uint8) (thr)) ) -#else -# define PHTREAD_TO_UI64(thr) ((PHYSFS_uint64) (thr)) -#endif - -PHYSFS_uint64 __PHYSFS_platformGetThreadID(void) +void *__PHYSFS_platformGetThreadID(void) { - return(PHTREAD_TO_UI64(pthread_self())); + return( (void *) ((size_t) pthread_self()) ); } /* __PHYSFS_platformGetThreadID */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/platform/windows.c new/physfs-2.0.3/platform/windows.c --- old/physfs-2.0.2/platform/windows.c 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/platform/windows.c 2012-10-23 05:41:04.000000000 +0200 @@ -462,6 +462,7 @@ */ rc = pGetUserProfileDirectoryW(accessToken, &dummy, &psize); assert(!rc); /* !!! FIXME: handle this gracefully. */ + (void)rc; /* Allocate memory for the profile directory */ wstr = (LPWSTR) __PHYSFS_smallAlloc(psize * sizeof (WCHAR)); @@ -559,9 +560,9 @@ } /* __PHYSFS_platformGetUserDir */ -PHYSFS_uint64 __PHYSFS_platformGetThreadID(void) +void *__PHYSFS_platformGetThreadID(void) { - return((PHYSFS_uint64) GetCurrentThreadId()); + return( (void *) ((size_t) GetCurrentThreadId()) ); } /* __PHYSFS_platformGetThreadID */ @@ -1142,7 +1143,7 @@ if ( (LowPos == PHYSFS_INVALID_SET_FILE_POINTER) && (GetLastError() != NO_ERROR) ) { - BAIL_MACRO(winApiStrError(), 0); + BAIL_MACRO(winApiStrError(), -1); } /* if */ else { @@ -1181,14 +1182,18 @@ int __PHYSFS_platformEOF(void *opaque) { + const PHYSFS_sint64 FileLength = __PHYSFS_platformFileLength(opaque); PHYSFS_sint64 FilePosition; int retval = 0; + if (FileLength == 0) + return 1; /* we're definitely at EOF. */ + /* Get the current position in the file */ - if ((FilePosition = __PHYSFS_platformTell(opaque)) != 0) + if ((FilePosition = __PHYSFS_platformTell(opaque)) != -1) { /* Non-zero if EOF is equal to the file length */ - retval = FilePosition == __PHYSFS_platformFileLength(opaque); + retval = (FilePosition == FileLength); } /* if */ return(retval); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/test/test_physfs.c new/physfs-2.0.3/test/test_physfs.c --- old/physfs-2.0.2/test/test_physfs.c 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/test/test_physfs.c 2012-10-23 05:41:04.000000000 +0200 @@ -27,7 +27,7 @@ #define TEST_VERSION_MAJOR 2 #define TEST_VERSION_MINOR 0 -#define TEST_VERSION_PATCH 2 +#define TEST_VERSION_PATCH 3 static FILE *history_file = NULL; static PHYSFS_uint32 do_buffer_size = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/physfs-2.0.2/test/wxtest_physfs.cpp new/physfs-2.0.3/test/wxtest_physfs.cpp --- old/physfs-2.0.2/test/wxtest_physfs.cpp 2011-02-18 22:17:31.000000000 +0100 +++ new/physfs-2.0.3/test/wxtest_physfs.cpp 2012-10-23 05:41:04.000000000 +0200 @@ -24,7 +24,7 @@ #define TEST_VER_MAJOR 2 #define TEST_VER_MINOR 0 -#define TEST_VER_PATCH 2 +#define TEST_VER_PATCH 3 //static PHYSFS_uint32 do_buffer_size = 0; -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
