$OpenBSD: patch-par2repairersourcefile_cpp,v 1.1.1.1 2004/01/23 05:20:48 jolan Exp $
--- par2repairersourcefile.cpp.orig	2003-05-26 13:01:27.000000000 -0500
+++ par2repairersourcefile.cpp	2004-01-21 18:06:05.000000000 -0600
@@ -68,9 +68,12 @@ void Par2RepairerSourceFile::ComputeTarg
 
   // Strip the path from the filename
   string::size_type where;
-  if (string::npos != (where = filename.find_last_of('\\')) ||
-      string::npos != (where = filename.find_last_of('/')) ||
-      string::npos != (where = filename.find_last_of(':')))
+  if (string::npos != (where = filename.find_last_of('\\'))
+      || string::npos != (where = filename.find_last_of('/'))
+#ifdef WIN32
+      || string::npos != (where = filename.find_last_of(':'))
+#endif
+     )
   {
     filename = filename.substr(where+1);
   }
@@ -141,3 +144,16 @@ void Par2RepairerSourceFile::SetBlocks(u
     }
   }
 }
+
+// Determine the block count from the file size and block size.
+void Par2RepairerSourceFile::SetBlockCount(u64 blocksize)
+{
+  if (descriptionpacket)
+  {
+    blockcount = (u32)((descriptionpacket->FileSize() + blocksize-1) / blocksize);
+  }
+  else
+  {
+    blockcount = 0;
+  }
+}
