mirror of
https://github.com/borgbackup/borg.git
synced 2025-01-03 05:35:58 +00:00
Fix corner case bug in chunify()
This commit is contained in:
parent
8d25f180f2
commit
a1bbe57460
3 changed files with 3 additions and 4 deletions
|
@ -111,11 +111,10 @@ ChunkifyIter_iternext(PyObject *self)
|
||||||
c->window_size);
|
c->window_size);
|
||||||
}
|
}
|
||||||
c->i++;
|
c->i++;
|
||||||
if(c->i == c->buf_size && c->last == c->window_size - 1)
|
if(c->i == c->buf_size && c->last == -1)
|
||||||
{
|
{
|
||||||
int old_last = c->last;
|
int old_last = c->last;
|
||||||
c->last = c->i - 1;
|
c->last = c->i - 1;
|
||||||
printf("Max chunk size reached %d\n", c->last - old_last);
|
|
||||||
return PyString_FromStringAndSize((char *)(c->data + old_last + 1),
|
return PyString_FromStringAndSize((char *)(c->data + old_last + 1),
|
||||||
c->last - old_last);
|
c->last - old_last);
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ def next(self):
|
||||||
self.data[self.i],
|
self.data[self.i],
|
||||||
self.window_size)
|
self.window_size)
|
||||||
self.i += 1
|
self.i += 1
|
||||||
if self.i == self.buf_size and self.last == self.window_size - 1:
|
if self.i == self.buf_size and self.last == -1:
|
||||||
old_last = self.last
|
old_last = self.last
|
||||||
self.last = self.i - 1
|
self.last = self.i - 1
|
||||||
return self.data[old_last + 1:self.last + 1]
|
return self.data[old_last + 1:self.last + 1]
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -8,7 +8,7 @@
|
||||||
author=u'Jonas Borgström',
|
author=u'Jonas Borgström',
|
||||||
author_email='jonas@borgstrom.se',
|
author_email='jonas@borgstrom.se',
|
||||||
packages=['dedupestore'],
|
packages=['dedupestore'],
|
||||||
ext_modules=[Extension('_speedups', ['dedupestore/_speedups.c'])],
|
ext_modules=[Extension('dedupestore._speedups', ['dedupestore/_speedups.c'])],
|
||||||
entry_points = {
|
entry_points = {
|
||||||
'console_scripts': [
|
'console_scripts': [
|
||||||
'dedupestore = dedupestore.archiver:main',
|
'dedupestore = dedupestore.archiver:main',
|
||||||
|
|
Loading…
Reference in a new issue