From 4b10f04c5c7930d0e68641677edeca3392518e16 Mon Sep 17 00:00:00 2001 From: Andres Mejia Date: Fri, 25 Jan 2013 22:43:17 -0500 Subject: [PATCH] Fix build failure when doing normal builds. These are builds done running a standard './configure && make'. This will also fix a corner case where the whence is set to anything other than SEEK_SET, SEEK_CUR, or SEEK_END. The behavior is to use SEEK_SET by default. --- libarchive/archive_read_support_format_rar.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c index 632908ea1..54f2f5f28 100644 --- a/libarchive/archive_read_support_format_rar.c +++ b/libarchive/archive_read_support_format_rar.c @@ -1026,14 +1026,15 @@ archive_read_format_rar_seek_data(struct archive_read *a, int64_t offset, /* Modify the offset for use with SEEK_SET */ switch (whence) { - case SEEK_SET: - client_offset = 0; - break; case SEEK_CUR: client_offset = rar->offset_seek; break; case SEEK_END: client_offset = rar->unp_size; + break; + case SEEK_SET: + default: + client_offset = 0; } client_offset += offset; if (client_offset < 0) -- 2.47.2