[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: bug in svn_string_strip_whitespace ?

From: <kfogel_at_collab.net>
Date: 2003-10-08 20:44:21 CEST

Martin Furter <mf@rola.ch> writes:
> I'm not sure if it's supposed to be this way but
> svn_string_strip_whitespace does not strip any spaces when the string
> only contains spaces.
>
> subversion/libsvn_subr/svn_string.c lines 188 - 195:
> apr_size_t offset = svn_string_first_non_whitespace (str);
>
> if (offset == str->len)
> return;
>
> /* Go ahead! Waste some RAM, we've got pools! :) */
> str->data += offset;
> str->len -= offset;
>
> I'd have expected that it would look like this:
> apr_size_t offset = svn_string_first_non_whitespace (str);
>
> str->data += offset;
> str->len -= offset;
> if (str->len == 0 )
> return;
>
> Is this a bug ?

I think it's a bug. The doc string implies that it should reduce such
a string to 0 length. Want to fix?

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Oct 8 21:19:29 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.