Change 12219 by pudge@pudge-mobile on 2001/09/26 00:19:35 Fix just a few of the bugs in Mac::InternetConfig (Bug #462999, Axel Rose); fix doc in Mac::Fonts (Patch #447221, Andreas Marcel Riechert). Affected files ... ... //depot/maint-5.6/macperl/macos/ext/Mac/Fonts/Fonts.xs#2 edit ... //depot/maint-5.6/macperl/macos/ext/Mac/InternetConfig/InternetConfig.pm#2 edit Differences ... ==== //depot/maint-5.6/macperl/macos/ext/Mac/Fonts/Fonts.xs#2 (text) ==== Index: perl/macos/ext/Mac/Fonts/Fonts.xs --- perl/macos/ext/Mac/Fonts/Fonts.xs.~1~ Tue Sep 25 18:30:06 2001 +++ perl/macos/ext/Mac/Fonts/Fonts.xs Tue Sep 25 18:30:06 2001 @@ -91,7 +91,8 @@ =item GetDefFontSize() -Get the default size of a font. +Get the current size of the system font if not set to 0. If the value is +set to 0 this function will return 12 as the font size. =cut short ==== //depot/maint-5.6/macperl/macos/ext/Mac/InternetConfig/InternetConfig.pm#2 (text) ==== Index: perl/macos/ext/Mac/InternetConfig/InternetConfig.pm --- perl/macos/ext/Mac/InternetConfig/InternetConfig.pm.~1~ Tue Sep 25 18:30:06 2001 +++ perl/macos/ext/Mac/InternetConfig/InternetConfig.pm Tue Sep 25 18:30:06 2001 @@ -583,45 +583,51 @@ kICFTPProxyAccount() => 'STR ', ); +# should accept only one item for tied interface sub _PackICFontRecord { my($size,$face,$font) = @_; return pack("sCx", $size, $face) . MacPack('STR ', $font); } +# should return only one item for tied interface sub _UnpackICFontRecord { my($blob) = @_; return (unpack("sC", $blob), MacUnpack('STR ', substr($blob, 4))); } +# should accept only one item for tied interface sub _PackICAppSpec { my($type,$name) = @_; return MacPack('type', $type) . MacPack('STR ', $name); } +# should return only one item for tied interface sub _UnpackICAppSpec { - my($blob) = @_; - + my $blob = shift or return; return (MacUnpack('type', $blob), MacUnpack('STR ', substr($blob, 4))); } +# should accept only one item for tied interface sub _PackICFileInfo { my($type,$creator,$name) = @_; return MacPack('type', $type) . MacPack('type', $creator) . MacPack('STR ', $name); } +# should return only one item for tied interface sub _UnpackICFileInfo { - my($blob) = @_; - + my $blob = shift or return; return (MacUnpack('type', $blob), MacUnpack('type', substr($blob, 4, 4)), MacUnpack('STR ', substr($blob, 8))); } +# should accept only one item for tied interface sub _PackICFileSpec { my($vol, $creation, $spec, $alias) = @_; $vol = substr(MacPack('STR ', $vol) . ('\0' x 32), 0, 32); return $vol . MacPack('long', $creation) . $spec . $alias->get; } +# should return only one item for tied interface sub _UnpackICFileSpec { my($blob) = @_; @@ -667,8 +673,9 @@ my($me, $key) = @_; my($data) = $RawInternetConfig{$key}; - if ($ictypes{$key}) { - return MacUnpack(\%ICUnpack, $ictypes{$key}, $data); + my $type = $ictypes{$key}; + if ($type && (exists $ICUnpack{$type} || exists $MacUnpack{$type})) { + return MacUnpack(\%ICUnpack, $type, $data); } else { return $data; } @@ -676,9 +683,9 @@ sub STORE { my($me, $key, @value) = @_; - - if ($ictypes{$key}) { - $RawInternetConfig{$key} = MacPack(\%ICPack, $ictypes{$key}, @value); + my $type = $ictypes{$key}; + if ($type && (exists $ICPack{$type} || exists $MacPack{$type})) { + $RawInternetConfig{$key} = MacPack(\%ICPack, $type, @value); } else { $RawInternetConfig{$key} = $value[0]; } End of Patch.