You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Doug MacEachern <do...@covalent.net> on 2000/08/16 05:18:46 UTC

Re: Totally trivial patch

On Mon, 10 Jul 2000 JoshNarins@aol.com wrote:

> 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?

not at all, more than welcome, thanks.
 
> 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.

yep.
 
> 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.

i'm not sure how much it would save, or if compilers would optimize that.
but, feel free to pass along anything else like this, even if it seems
trivial.