mirror of
https://github.com/hashcat/hashcat.git
synced 2025-08-01 03:18:17 +00:00
Merge pull request #4300 from Oblivionsage/fix-xz-seek-todo
Fix XZ file seek operation in hc_fseek()
This commit is contained in:
commit
3981f284af
@ -579,7 +579,18 @@ int hc_fseek (HCFILE *fp, off_t offset, int whence)
|
|||||||
}
|
}
|
||||||
else if (fp->xfp)
|
else if (fp->xfp)
|
||||||
{
|
{
|
||||||
/* TODO */
|
/* XZ files are compressed streams, seeking is limited */
|
||||||
|
if (offset == 0 && whence == SEEK_SET)
|
||||||
|
{
|
||||||
|
/* Rewind to beginning */
|
||||||
|
hc_rewind(fp);
|
||||||
|
r = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Arbitrary seeking not supported for compressed XZ files */
|
||||||
|
r = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
|
Loading…
Reference in New Issue
Block a user