mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 23:49:35 -05:00
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:
parent
8c1df60e49
commit
9033e4fa56
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user