]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix build failure when doing normal builds.
authorAndres Mejia <amejia004@gmail.com>
Sat, 26 Jan 2013 03:43:17 +0000 (22:43 -0500)
committerAndres Mejia <amejia004@gmail.com>
Sat, 26 Jan 2013 03:43:17 +0000 (22:43 -0500)
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

index 632908ea18dad833d8dc50d67b40c92c260ef62f..54f2f5f28a0c3ad96c5bdb976fc95cc0a76ea61b 100644 (file)
@@ -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)