diff options
author | Julian Andres Klode <jak@debian.org> | 2016-02-10 12:45:47 +0100 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2016-02-10 12:48:37 +0100 |
commit | eda0c1ba43cd3ae0ed85aba2c31573f156cec9c4 (patch) | |
tree | 6871517513059c4badd9034ed76f06b8861dd669 /apt-pkg/contrib | |
parent | ffb3bbfcc2c7cf067ce17e3e994e909718584458 (diff) |
Set seekpos to 0 after reopening files in Seek()
If we just reopened the file, we also need to reset the current
seek position when we reset the buffer, otherwise the code will
not try to seek to the position given to Skip (from 0), but will
try to seek to old offset + the position given to skip.
Closes: #812994, #813000
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r-- | apt-pkg/contrib/fileutl.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 297172eea..eae4d233e 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -1119,6 +1119,7 @@ public: return filefd->FileFdError("Seek on file %s because it couldn't be reopened", filefd->FileName.c_str()); buffer.reset(); + set_seekpos(0); if (To != 0) return filefd->Skip(To); |