fix use of getcwd in make_torrent on windows

This commit is contained in:
Arvid Norberg 2015-01-08 20:20:44 +00:00
parent 05f8569f9f
commit 79feb037b2
1 changed files with 6 additions and 1 deletions

View File

@ -42,6 +42,10 @@ POSSIBILITY OF SUCH DAMAGE.
#include <boost/bind.hpp>
#ifdef TORRENT_WINDOWS
#include <direct.h> // for _getcwd
#endif
using namespace libtorrent;
int load_file(std::string const& filename, std::vector<char>& v, libtorrent::error_code& ec, int limit = 8000000)
@ -284,10 +288,11 @@ int main(int argc, char* argv[])
#endif
{
char cwd[TORRENT_MAX_PATH];
getcwd(cwd, sizeof(cwd));
#ifdef TORRENT_WINDOWS
_getcwd(cwd, sizeof(cwd));
full_path = cwd + ("\\" + full_path);
#else
getcwd(cwd, sizeof(cwd));
full_path = cwd + ("/" + full_path);
#endif
}