[fpc-devel] zstream, fpc and lazarus

Daniël Mantione daniel.mantione at freepascal.org
Sun Dec 2 09:36:46 CET 2007



Op Sun, 2 Dec 2007, schreef Paul Ishenin:

> Daniël Mantione ?????:
> >  Ok, read with me. If we seek backwards (which is the case with offset 0
> > from beginning), we call reset:
> > 
> > if origin=sofrombeginning then
> >  dec(offset,raw_read);
> > if offset<0 then
> > begin
> > inc(offset,raw_read);
> > reset;
> > end;
> > 
> > Inside reset, we set the source stream position to 0:
> > 
> No, Daniel. When we just create TDecompressionStream we seeks to
> soFromBeginning, 0. We have raw_read = 0, so offset = 0 too after dec(offset,
> raw_read). And next condition with offset < 0 then is false 
> =>  so no reset call.
> 
> I fixed that locally after your commit and lazarus works.

This seems extremely strange to me. Are you telling that the source stream 
is not at the start of the Zstream when you create the decompression stream?

By the way, I'm getting some doubts about position:=0. This basically 
seeks the source file to its begin. But what happens if the Zstream does 
not start at the beginning of the file?

Daniël


More information about the fpc-devel mailing list