Folks,

I just updated MacOSX::File to 0.65. This is mainly thanks to a bug report from Guy Sabourin that addresses a minor typecast bug in Catalog/Catalog.xs that copies creator improperly when compiled in certain condition (the condition I could not duplicate; I suspect the compiler difference).
Since Guy's version is definitely less evil and far portable I replaced the code in question with Guy's version.

On Monday, Jan 20, 2003, at 02:02 Asia/Tokyo, Guy Sabourin wrote:
    (from: catalog.xs, line 77, source version 0.62 (from MacOSX-File-0.64)):

    finderInfo[0] = sv_2mortal(newSVpv((char *)fip, 4));      /* type */
    finderInfo[1] = sv_2mortal(newSVpv((char *)(fip+4), 4));  /* creator */   <--- Should work, but does not!
   finderInfo[2] = sv_2mortal(newSVuv(fip->fdFlags));

Because I kept getting garbage in MacOSX::File::Catalog, but MacOSX::File::Info would return a correct creator, I suspected some form of incorrect pointer calculation. I therefore tried the following changes:

    finderInfo[0] = sv_2mortal(newSVpv((char *)&fip->fdType, 4));      /* type */
    finderInfo[1] = sv_2mortal(newSVpv((char *)&fip->fdCreator, 4));  /* creator */
    finderInfo[2] = sv_2mortal(newSVuv(fip->fdFlags));
And here is the Changes.

$Revision: 0.65 $ $Date: 2003/01/19 17:53:21 $
! common/util.c
s/strcpy/strncpy/ I though I fixed it :)
! Catalog/Catalog.xs
Guy Sabourin <[EMAIL PROTECTED]> has reported that an evil typecast
found in the code above was preventing MacOSX::File::Catalog from
copying creator properly. Though I could not duplicate his claim
on my environment (compiler difference?), his version is definitely
better.
Message-Id: <[EMAIL PROTECTED]>
FYI, psync and other scripts that come with this package use
MacOSX::File::Info rather than MacOSX::File:Catalog in favor of speed
and memory so they are unaffected as of this release.

As described above, psync and other popular scripts REMAIN unaffected. Enjoy.

Dan the Man with Too Many Modules to Maintain

Reply via email to