Advertisement

scriptfilesystem copy file bug fix (posix)

Started by May 05, 2020 02:41 PM
2 comments, last by gjl 4 years, 6 months ago

Hi,

I have noticed a typo in the POSIX version of the copyfile function in the filesystem add-on, which actually causes a bug (files are not copied). Please find below a fix (line numbers may not match as I am still on the previous version of Angelscript without the date functions):

--- scriptfilesystem.cpp	(revision original)
+++ scriptfilesystem.cpp	(revision fixed)
@@ -452,7 +452,7 @@
 	FILE *src = 0, *tgt = 0;
 	src = fopen(search1.c_str(), "r");
 	if (src == 0) failure = true;
-	if( !failure ) tgt - fopen(search2.c_str(), "w");
+	if( !failure ) tgt = fopen(search2.c_str(), "w");
 	if (tgt == 0) failure = true;
 	char buf[1024];
 	size_t n;

Thanks, but this was fixed almost 2 years ago in revision 2548.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement

Oh indeed, sorry! I definitely have to update :-)

This topic is closed to new replies.

Advertisement