Re: Was [Re: [evolution-patches] itip-formatter plugin invocation URI fix.]
- From: Jeffrey Stedfast <fejj novell com>
- To: Veerapuram Varadhan <vvaradhan novell com>
- Cc: evo-patches <evolution-patches lists ximian com>
- Subject: Re: Was [Re: [evolution-patches] itip-formatter plugin invocation URI fix.]
- Date: Thu, 07 Jul 2005 16:45:47 -0400
On Fri, 2005-07-08 at 01:45 +0530, Veerapuram Varadhan wrote:
> - slash = uri_string + strcspn (uri_string, "/#");
> + /*
> + * Play safe. ;-)
> + * If username, password, host, port things are not
> + * specified in the url, find a way to not crib about
> + * them. So, check for the "existance" of magic "/"
> or
> + * "#" which will give a clue about the presence of
> something
> + * that we are looking for.
> + */
> +
> + slash = strchr (uri_string, '/');
> + if (!slash)
> + slash = strchr (uri_string, '#');
> + if (slash)
> + slash = uri_string + strcspn (uri_string,
> "/#");
> + else
> + slash = uri_string;
> +
read up on what strcspn does. your above code changes duplicate the code
you replaced (almost) but does it in a less efficient manner.
instead, the following change is simpler:
if ((slash = uri_string + strcspn (uri_string, "/#"))[0] == 0)
slash = uri_string;
however, looking over the e-url.c code, I fail to see how this actually
solves the problem. In fact, I fail to see any problem at all in the
original code. Please explain what exactly the problem is...
> -
> - uri_string = slash;
> + /* move the pointer appropriately ;-) */
> + if (slash > uri_string)
> + uri_string = slash;
this change won't be needed
--
Jeffrey Stedfast
Evolution Hacker - Novell, Inc.
fejj ximian com - www.novell.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]