Deleted Added
full compact
archive_read.c (348607) archive_read.c (349900)
1/*-
2 * Copyright (c) 2003-2011 Tim Kientzle
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 18 unchanged lines hidden (view full) ---

27 * This file contains the "essential" portions of the read API, that
28 * is, stuff that will probably always be used by any client that
29 * actually needs to read an archive. Optional pieces have been, as
30 * far as possible, separated out into separate files to avoid
31 * needlessly bloating statically-linked clients.
32 */
33
34#include "archive_platform.h"
1/*-
2 * Copyright (c) 2003-2011 Tim Kientzle
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 18 unchanged lines hidden (view full) ---

27 * This file contains the "essential" portions of the read API, that
28 * is, stuff that will probably always be used by any client that
29 * actually needs to read an archive. Optional pieces have been, as
30 * far as possible, separated out into separate files to avoid
31 * needlessly bloating statically-linked clients.
32 */
33
34#include "archive_platform.h"
35__FBSDID("$FreeBSD: stable/11/contrib/libarchive/libarchive/archive_read.c 348607 2019-06-04 10:35:54Z mm $");
35__FBSDID("$FreeBSD: stable/11/contrib/libarchive/libarchive/archive_read.c 349900 2019-07-11 00:21:47Z mm $");
36
37#ifdef HAVE_ERRNO_H
38#include <errno.h>
39#endif
40#include <stdio.h>
41#ifdef HAVE_STDLIB_H
42#include <stdlib.h>
43#endif

--- 795 unchanged lines hidden (view full) ---

839 size_t bytes_read;
840 size_t len;
841 int r;
842
843 bytes_read = 0;
844 dest = (char *)buff;
845
846 while (s > 0) {
36
37#ifdef HAVE_ERRNO_H
38#include <errno.h>
39#endif
40#include <stdio.h>
41#ifdef HAVE_STDLIB_H
42#include <stdlib.h>
43#endif

--- 795 unchanged lines hidden (view full) ---

839 size_t bytes_read;
840 size_t len;
841 int r;
842
843 bytes_read = 0;
844 dest = (char *)buff;
845
846 while (s > 0) {
847 if (a->read_data_remaining == 0) {
847 if (a->read_data_offset == a->read_data_output_offset &&
848 a->read_data_remaining == 0) {
848 read_buf = a->read_data_block;
849 a->read_data_is_posix_read = 1;
850 a->read_data_requested = s;
851 r = archive_read_data_block(a, &read_buf,
852 &a->read_data_remaining, &a->read_data_offset);
853 a->read_data_block = read_buf;
854 if (r == ARCHIVE_EOF)
855 return (bytes_read);

--- 895 unchanged lines hidden ---
849 read_buf = a->read_data_block;
850 a->read_data_is_posix_read = 1;
851 a->read_data_requested = s;
852 r = archive_read_data_block(a, &read_buf,
853 &a->read_data_remaining, &a->read_data_offset);
854 a->read_data_block = read_buf;
855 if (r == ARCHIVE_EOF)
856 return (bytes_read);

--- 895 unchanged lines hidden ---