From 95c0cda62587c7f3b19f55717880a7b5d700cb24 Mon Sep 17 00:00:00 2001 From: torque Date: Mon, 23 Feb 2015 19:15:18 -0800 Subject: [PATCH] DownloadManager: write binary files. Keeps Windows from screwing up the line endings, which messes with the checksum of the file. --- threaded-libcurl/DownloadManager.hpp | 2 +- threaded-libcurl/DownloadManager.moon | 2 +- threaded-libcurl/Downloader.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/threaded-libcurl/DownloadManager.hpp b/threaded-libcurl/DownloadManager.hpp index 9840399..a89c9db 100644 --- a/threaded-libcurl/DownloadManager.hpp +++ b/threaded-libcurl/DownloadManager.hpp @@ -9,7 +9,7 @@ class DownloadManager { unsigned int finishedCount = 0, addedCount = 0, failedCount = 0; public: - const static unsigned int version = 0x000100; + const static unsigned int version = 0x000101; DownloadManager( void ); ~DownloadManager( void ); double getProgress( void ); diff --git a/threaded-libcurl/DownloadManager.moon b/threaded-libcurl/DownloadManager.moon index 25c7105..9695841 100644 --- a/threaded-libcurl/DownloadManager.moon +++ b/threaded-libcurl/DownloadManager.moon @@ -71,7 +71,7 @@ class DownloadManager @version_string = "0.1.2" DM = nil - DMVersion = 0x000100 + DMVersion = 0x000101 pathExt = "/automation/include/#{@__name}/#{(ffi.os != windows) and 'lib' or ''}#{@__name}.#{(OSX: 'dylib', Windows: 'dll')[ffi.os] or 'so'}" defaultLibraryPaths = aegisub and {aegisub.decode_path("?user"..pathExt), aegisub.decode_path("?data"..pathExt)} or {@__name} msgs = { diff --git a/threaded-libcurl/Downloader.cpp b/threaded-libcurl/Downloader.cpp index 6afab51..0b8491d 100644 --- a/threaded-libcurl/Downloader.cpp +++ b/threaded-libcurl/Downloader.cpp @@ -73,7 +73,7 @@ void Downloader::finalize( void ) { } } - std::fstream outStream( outfile, std::fstream::out ); + std::fstream outStream( outfile, std::ios::out | std::ios::binary ); if (outStream.fail( )) { error = "Couldn't open output file: " + outfile; failed = true;