Bugfix on file manipulation

Corrects wrong logic when using Win32 API for handling the filesystem, Win32 functions return 0 for an error while POSIX functions return 0 for a success.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3146 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
leander-256 2010-06-16 16:18:08 +00:00
parent 8c1df60e49
commit 9033e4fa56

View File

@ -604,7 +604,7 @@ bool ftController::moveFile(const std::string& source,const std::string& dest)
librs::util::ConvertUtf8ToUtf16(source,sourceW);
librs::util::ConvertUtf8ToUtf16(dest,destW);
if( 0 == MoveFileW(sourceW.c_str(), destW.c_str()))
if( 0 != MoveFileW(sourceW.c_str(), destW.c_str()))
#else
if (0 == rename(source.c_str(), dest.c_str()))
#endif
@ -637,7 +637,7 @@ bool ftController::moveFile(const std::string& source,const std::string& dest)
std::cerr << "deleting original file " << source << std::endl ;
#ifdef WINDOWS_SYS
if(0 == DeleteFileW(sourceW.c_str()))
if(0 != DeleteFileW(sourceW.c_str()))
#else
if(0 == remove(source.c_str()))
#endif