Skip to content

Commit 05ea94e

Browse files
committed
Fixed asm2wasm crashing on files containing '\r' when built with MinGW
1 parent a88d9b8 commit 05ea94e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/support/file.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ T wasm::read_file(const std::string &filename, Flags::BinaryOption binary, Flags
2626
if (debug == Flags::Debug) std::cerr << "Loading '" << filename << "'..." << std::endl;
2727
std::ifstream infile;
2828
std::ios_base::openmode flags = std::ifstream::in;
29-
if (binary == Flags::Binary) flags |= std::ifstream::binary;
29+
// asm2wasm.exe built with MinGW would crash with files containing '\r' when opened without the binary flag
30+
/*if (binary == Flags::Binary) */flags |= std::ifstream::binary;
3031
infile.open(filename, flags);
3132
if (!infile.is_open()) {
3233
std::cerr << "Failed opening '" << filename << "'" << std::endl;

0 commit comments

Comments
 (0)