🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

scriptfilesystem copy file bug fix (posix)

Started by
2 comments, last by gjl 4 years, 1 month 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;
Advertisement

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

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

This topic is closed to new replies.

Advertisement