]> git.ipfire.org Git - people/ms/pakfire.git/commitdiff
compress: Keep going after all data has been read into the input buffer
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 19 Mar 2021 15:12:34 +0000 (15:12 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 19 Mar 2021 15:12:34 +0000 (15:12 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/compress.c

index 220bf5150acbaee8aabf73960051dd7e63053faf..1160b624db88229dcc289b1d42240e71893eb89d 100644 (file)
@@ -123,10 +123,6 @@ static ssize_t xz_read(void* data, char* buffer, size_t size) {
        if (cookie->mode == 'w')
                return -1;
 
-       // Return nothing after we are done
-       if (cookie->done)
-               return 0;
-
        lzma_action action = LZMA_RUN;
 
        // Set output to allocated buffer
@@ -145,10 +141,8 @@ static ssize_t xz_read(void* data, char* buffer, size_t size) {
                                return -1;
 
                        // Finish after we have reached the end of the input file
-                       if (feof(cookie->f)) {
-                               action = LZMA_FINISH;
+                       if (feof(cookie->f))
                                cookie->done = 1;
-                       }
                }
 
                lzma_ret ret = lzma_code(&cookie->stream, action);