You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jo...@aol.com on 2000/07/10 19:31:17 UTC

Totally trivial patch

Hi Doug,

  I was trying to figure out how to hide part of the URL of an 
$r->custom_response from the user and I found this...

It's real trivial, does that matter?

I assume that if (*string == '/') then of course (*string != '"').
I am also assuming that || and && work the same in .xs as they would in perl.

This is a patch against the current CVS.

--- Apache.xs   Mon Jun  5 18:20:44 2000
+++ Apache.xs.new       Mon Jul 10 11:41:47 2000
@@ -264,7 +264,7 @@
     retval = conf->response_code_strings[idx];
     if (string) {
        conf->response_code_strings[idx] =
-           ((is_url(string) || (*string == '/')) && (*string != '"')) ?
+           ((is_url(string) && (*string != '"')) || (*string == '/')) ?
                pstrdup(r->pool, string) : pstrcat(r->pool, "\"", string, NULL);
     }



By the way, I know (and am sorry about) the fact that you all have spent
more time reading about this than all the CPU cycles this patch will ever
save combined, I think.  And maybe every known compiler sees the issue and
compiles both versions the same way, anyway.

-Josh "Please feel free to ask me to stop trying" Narins

Everybody was a baby once, Arthur. Oh, sure, maybe not today, or even
yesterday. But once! Babies, chum: tiny, dimpled, fleshy mirrors of our
us-ness, that we parents hurl into the future, like leathery footballs of hope!
And you've got to get a good spiral on that baby, or evil will make an
interception! --- The Tick, (1995)