diff options
author | Xin LI <delphij@FreeBSD.org> | 2023-01-01 04:23:22 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2023-01-01 04:23:22 +0000 |
commit | f6a891c2b422c077f3c8b764d0ebe4356f88fd23 (patch) | |
tree | 0ad7f804aae1b93eefbf55d70e33fa8a0d8ea366 /src/liblzma/common/common.c | |
parent | 46780ea2dc97a43538e5dca6513baea560aeb839 (diff) | |
download | src-f6a891c2b422c077f3c8b764d0ebe4356f88fd23.tar.gz src-f6a891c2b422c077f3c8b764d0ebe4356f88fd23.zip |
Vendor import of xz 5.4.0 (trimmed)vendor/xz/5.4.0
Diffstat (limited to 'src/liblzma/common/common.c')
-rw-r--r-- | src/liblzma/common/common.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/liblzma/common/common.c b/src/liblzma/common/common.c index 10fc884099a4..a708fdf187a6 100644 --- a/src/liblzma/common/common.c +++ b/src/liblzma/common/common.c @@ -211,7 +211,6 @@ lzma_code(lzma_stream *strm, lzma_action action) || strm->reserved_ptr2 != NULL || strm->reserved_ptr3 != NULL || strm->reserved_ptr4 != NULL - || strm->reserved_int1 != 0 || strm->reserved_int2 != 0 || strm->reserved_int3 != 0 || strm->reserved_int4 != 0 @@ -299,9 +298,7 @@ lzma_code(lzma_stream *strm, lzma_action action) strm->internal->avail_in = strm->avail_in; - // Cast is needed to silence a warning about LZMA_TIMED_OUT, which - // isn't part of lzma_ret enumeration. - switch ((unsigned int)(ret)) { + switch (ret) { case LZMA_OK: // Don't return LZMA_BUF_ERROR when it happens the first time. // This is to avoid returning LZMA_BUF_ERROR when avail_out @@ -322,6 +319,17 @@ lzma_code(lzma_stream *strm, lzma_action action) ret = LZMA_OK; break; + case LZMA_SEEK_NEEDED: + strm->internal->allow_buf_error = false; + + // If LZMA_FINISH was used, reset it back to the + // LZMA_RUN-based state so that new input can be supplied + // by the application. + if (strm->internal->sequence == ISEQ_FINISH) + strm->internal->sequence = ISEQ_RUN; + + break; + case LZMA_STREAM_END: if (strm->internal->sequence == ISEQ_SYNC_FLUSH || strm->internal->sequence == ISEQ_FULL_FLUSH |