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; + } } }