Add a workaround for situations where OSX seems to add an extra 0x52 bytes to the start of the resource fork.

This commit is contained in:
Erik de Castro Lopo 2006-03-04 03:05:06 +00:00
parent 38b0379186
commit c0622ed1b3
2 changed files with 13 additions and 1 deletions

View File

@ -8,6 +8,10 @@
Fix an ia64 problem where a varargs function was being passed an int in
some places and a size_t in other places.
* src/sd2.c
Add a workaround for situations where OSX seems to add an extra 0x53 bytes
to the start of the resource fork.
2006-02-19 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* Mingw-make-dist.sh

View File

@ -1,5 +1,5 @@
/*
** Copyright (C) 2001-2004 Erik de Castro Lopo <erikd@mega-nerd.com>
** Copyright (C) 2001-2006 Erik de Castro Lopo <erikd@mega-nerd.com>
** Copyright (C) 2004 Paavo Jumppanen
**
** This program is free software; you can redistribute it and/or modify
@ -435,6 +435,14 @@ sd2_parse_rsrc_fork (SF_PRIVATE *psf)
rsrc.data_length = read_int (rsrc.rsrc_data, 8) ;
rsrc.map_length = read_int (rsrc.rsrc_data, 12) ;
if (rsrc.data_offset == 0x51607 && rsrc.map_offset == 0x20000)
{ psf_log_printf (psf, "Trying offset of 0x52 bytes.\n") ;
rsrc.data_offset = read_int (rsrc.rsrc_data, 0x52 + 0) + 0x52 ;
rsrc.map_offset = read_int (rsrc.rsrc_data, 0x52 + 4) + 0x52 ;
rsrc.data_length = read_int (rsrc.rsrc_data, 0x52 + 8) ;
rsrc.map_length = read_int (rsrc.rsrc_data, 0x52 + 12) ;
} ;
psf_log_printf (psf, " data offset : 0x%04X\n map offset : 0x%04X\n"
" data length : 0x%04X\n map length : 0x%04X\n",
rsrc.data_offset, rsrc.map_offset, rsrc.data_length, rsrc.map_length) ;