-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tue, May 28, 2002 at 03:50:15PM -0400, Geoffrey Young wrote:
> I'm not sure, though, if this isn't a more pervasive bug for other
> request_rec fields. I added some trace statements in Apache.xs and it
> seems that even if $val is undef that ST(1) in query_string() in still
> defined.
As it should be. You can't just skip passing the SV pointer, of course -- well,
you *could* (and it would make life in XS substantially easier, in all honesty),
but Perl don't play dat; it will pass &PL_sv_undef or a reasonable facsimilie
instead.
Comparing pointers like this always strikes me as Evil and Wrong (tm) for some
reason. Particularly in this case, since I don't believe there's a guarantee
that undef (in Perlspace) == &PL_sv_undef for all values of undef. Suppose some
bastard clobbered a former string SV with sv_setsv. I've done it :)
So this:
thing = (char*)((ST(1) == &sv_undef) ? NULL : pstrdup(p, SvPV(ST(1),na)))
Probably intends to read:
thing = (char*)((SvOK(ST(1))) ? pstrdup(p, SvPV(ST(1),na) : NULL)
Someone correct me if I'm wrong.
- --
Stephen Clouse <[EMAIL PROTECTED]>
Senior Programmer, IQ Coordinator Project Lead
The IQ Group, Inc. <http://www.theiqgroup.com/>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iEYEARECAAYFAjz0XZoACgkQA4aoazQ9p2cMfQCdGFh+bp7fc27DEX6OTWiLNDI5
DlsAn1Izldmt/A4SMI28MVLXGQGLL3QF
=OHxX
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]