From 0e28b521a60d0574504f34ab4d88fca208dbab96 Mon Sep 17 00:00:00 2001 From: Lewis Clark Date: Thu, 24 Nov 2022 12:37:38 +0000 Subject: [PATCH 1/2] Replace \n with std::endl --- src/lua/luadumper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lua/luadumper.cpp b/src/lua/luadumper.cpp index 86cb35a..3ade888 100644 --- a/src/lua/luadumper.cpp +++ b/src/lua/luadumper.cpp @@ -68,9 +68,9 @@ void glt::lua::IoThread() { } auto of = std::ofstream(path, glt::config::GetConfig().stealer_write_mode); - of << "-- " << sanitized_filename << "\n"; - of << "-- Retrieved by https://github.com/lewisclark/glua-steal\n"; - of << entry.code << "\n\n"; + of << "-- " << sanitized_filename << std::endl; + of << "-- Retrieved by https://github.com/lewisclark/glua-steal" << std::endl; + of << entry.code; } shared_entries.clear(); From c60b381a8fb05bf85b1b513db1b3fe0ae44f539c Mon Sep 17 00:00:00 2001 From: Lewis Clark Date: Thu, 24 Nov 2022 12:38:13 +0000 Subject: [PATCH 2/2] Write code in binary mode --- src/lua/luadumper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua/luadumper.cpp b/src/lua/luadumper.cpp index 3ade888..870c4bd 100644 --- a/src/lua/luadumper.cpp +++ b/src/lua/luadumper.cpp @@ -67,7 +67,7 @@ void glt::lua::IoThread() { continue; } - auto of = std::ofstream(path, glt::config::GetConfig().stealer_write_mode); + auto of = std::ofstream(path, glt::config::GetConfig().stealer_write_mode | std::ofstream::binary); of << "-- " << sanitized_filename << std::endl; of << "-- Retrieved by https://github.com/lewisclark/glua-steal" << std::endl; of << entry.code;