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

Re: Mark/seek/reset problems in svn_subst_stream_translated()

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Thu, 15 Apr 2010 16:06:46 +0100

Stefan Sperling wrote:
> On Thu, Apr 15, 2010 at 02:18:22PM +0100, Julian Foad wrote:
> > I noticed some oddities/problems with the stream mark/seek/reset
> > functionality in svn_subst_stream_translated().
> >
> > 1.
> > svn_subst_stream_translated() doesn't handle mark/seek properly.
> > translated_stream_mark() saves and translated_stream_seek() restores
> > only the source stream's position, and not the internal state of
> > translation which it resets to "not in a translation". This will work
> > properly only if the marked position is not inside a keyword or EOL. It
> > needs to store (into the mark structure) the current state of
> > translation as well.
> >
> > (An alternative could be to attach conditions to the use of mark/seek:
> > "this only works if you do XXX" - but I think that would be a Bad Thing.
> > The concept of streams works well precisely because we can layer
> > arbitrary streams on top of each other and expect them to work without
> > having to worry about such conditions.)
> >
> > 2.
> > translated_stream_seek() first flushes the output buffer, but
> > translated_stream_reset() doesn't. I think that's a bug in _reset.
>
> I think I added this support and have probably made these mistakes.
> Can you file an issue to track these problems?

Filed as issues #3616
<http://subversion.tigris.org/issues/show_bug.cgi?id=3616>, #3617
<http://subversion.tigris.org/issues/show_bug.cgi?id=3617>.

- Julian
Received on 2010-04-15 17:07:20 CEST

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.