From 25c7518a8c373098934693de47af6e1b61f436fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Strohh=C3=A4cker?= Date: Tue, 22 Sep 2009 21:48:08 +0000 Subject: [PATCH] backwrap directory iterator variable for iso drive in free iterator function (thanks to rcblanke; fixes armored fist 2 installer on an iso drive) Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3467 --- src/dos/drive_iso.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/dos/drive_iso.cpp b/src/dos/drive_iso.cpp index c3451001..4135d734 100644 --- a/src/dos/drive_iso.cpp +++ b/src/dos/drive_iso.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: drive_iso.cpp,v 1.26 2009-06-19 18:28:10 c2woody Exp $ */ +/* $Id: drive_iso.cpp,v 1.27 2009-09-22 21:48:08 c2woody Exp $ */ #include #include @@ -430,7 +430,11 @@ void isoDrive::FreeDirIterator(const int dirIterator) { // if this was the last aquired iterator decrement nextFreeIterator if ((dirIterator + 1) % MAX_OPENDIRS == nextFreeDirIterator) { - nextFreeDirIterator--; + if (nextFreeDirIterator>0) { + nextFreeDirIterator--; + } else { + nextFreeDirIterator = MAX_OPENDIRS-1; + } } }