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

Re: svn commit: r11483 - trunk/subversion/libsvn_subr

From: John Szakmeister <john_at_szakmeister.net>
Date: 2004-10-20 12:32:44 CEST

On Tuesday 19 October 2004 23:41, Branko Čibej wrote:
> John Szakmeister wrote:
[snip]
> >Is it really worth the effort? I mean, now we have an svn_error_t to
> >handle, only we can't return that. So now we have to clear, set
> > apr_err to something meaningful so we can error out later. I'm not
> > sure it makes the logic that much cleaner to follow. In fact, I
> > would say the opposite.
> >
> >If you think it is worth the effort, I'll make the changes... I just
> > don't want to obfuscate what's really happening any more than
> > necessary.
>
> Now that I took a closer look at the surrounding code, I think the
> current way is better, too.

I'll leave it as it is then, and put the change into STATUS.

> >Also, do you know what the purpose behind this line is:
> > utf8_path[outlength - outbytes] = '\0';
> >
> >I believe that it's trying to set a NULL character at the end of the
> >string, which should really be:
> > utf8_path[outbytes] = '\0';
> >
> >Or am I missing something?
>
> Yes, you are. :-) After conversion, APR sers outbytes to the number of
> bytes left in the buffer, not the number of bytes converted. That's
> useful, because you can do several concatenating conversions in a row
> into the same buffer without having to twiddle the outbytes parameter.

Ah, that explains it. I was working from my Linux box last night, so when
I hunted through APR's header files, I couldn't find the function...

> If that line of code were wrong, we'd definitely have noticed it
> before, don't you think? :-)

Yes, I do, but I thought someone would have noticed that ucs2_path made it
through uninitialized earlier than now too. :-)

Thanks for the review!

-John

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Oct 20 12:33:09 2004

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.