more updates, still not right.
[feisty_meow.git] / nucleus / library / filesystem / heavy_file_ops.cpp
index 82d978fc1e0f0921e0df085f54020bbe127be72b..3ddd76648930cee349a1d8f2b6dd467bd19ca7af 100644 (file)
@@ -211,12 +211,10 @@ outcome heavy_file_operations::write_file_chunk(const astring &target,
 basis::outcome heavy_file_operations::advance(const filename_list &to_transfer,
     file_transfer_header &last_action)
 {
-#ifdef DEBUG_HEAVY_FILE_OPS
   FUNCDEF("advance");
-#endif
   int indy = to_transfer.locate(last_action._filename);
   if (negative(indy)) return BAD_INPUT;  // error, file not found in list.
-  if (indy == to_transfer.elements() - 1) return FINISHED;  // done.
+  if (indy >= to_transfer.elements() - 1) return FINISHED;  // done.
   const file_info *currfile = to_transfer.get(indy + 1);
   last_action._filename = currfile->raw();
   last_action._time = currfile->_time;