From be42f298dafae88507564533c7d622eda70caea8 Mon Sep 17 00:00:00 2001
From: Jeffrey Pfau <jeffrey@endrift.com>
Date: Sun, 7 Feb 2016 22:24:07 -0800
Subject: [PATCH] VFS: Fix reading 7z archives without rewinding first

---
 CHANGES                 | 4 ++++
 src/util/vfs/vfs-lzma.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/CHANGES b/CHANGES
index 42bc8e38e..63ba76ed9 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+0.5.0: (Future)
+Bugfixes:
+ - VFS: Fix reading 7z archives without rewinding first
+
 0.4.0: (2016-02-02)
 Features:
  - Officially supported ports for the Nintendo 3DS, Wii, and PlayStation Vita
diff --git a/src/util/vfs/vfs-lzma.c b/src/util/vfs/vfs-lzma.c
index fe2778ede..255e87322 100644
--- a/src/util/vfs/vfs-lzma.c
+++ b/src/util/vfs/vfs-lzma.c
@@ -103,7 +103,7 @@ struct VDir* VDirOpen7z(const char* path, int flags) {
 		return 0;
 	}
 
-	vd->dirent.index = 0;
+	vd->dirent.index = -1;
 	vd->dirent.utf8 = 0;
 	vd->dirent.vd = vd;
 	vd->dirent.d.name = _vde7zName;