$OpenBSD: patch-src_PartFile_h,v 1.1 2016/06/03 11:54:44 dcoppa Exp $

From f2c05727c232b607be5a3b8b78279a669b1e7ef3 Mon Sep 17 00:00:00 2001
From: upstream svn <svn@amule.org>
Date: Sat, 16 Apr 2016 19:16:44 +0000
Subject: [PATCH] Fix crash when importing partfiles with the
"Preallocate space for new files" preference option enabled

Imported parfiles won't have their space preallocated even if it
is requested in the preferences. The whole importing strategy should
be changed for that, and we'd lose many optimizations meanwhile.
On the other hand, the "create sparse files" preference setting is
taken into account.

--- src/PartFile.h.orig	Fri Jun  3 12:14:31 2016
+++ src/PartFile.h	Fri Jun  3 12:14:54 2016
@@ -300,7 +300,7 @@ class CPartFile : public CKnownFile { (private)
 	bool	GetNextEmptyBlockInPart(uint16 partnumber,Requested_Block_Struct* result);
 	bool	IsAlreadyRequested(uint64 start, uint64 end);
 	void	CompleteFile(bool hashingdone);
-	void	CreatePartFile();
+	void	CreatePartFile(bool isImporting = false);
 	void	Init();
 
 	bool	CheckFreeDiskSpace( uint64 neededSpace = 0 );
