diff --git a/src/libutil/windows/file-descriptor.cc b/src/libutil/windows/file-descriptor.cc index 274e5844f5f..bd2c4049aa5 100644 --- a/src/libutil/windows/file-descriptor.cc +++ b/src/libutil/windows/file-descriptor.cc @@ -60,7 +60,7 @@ void writeFull(HANDLE handle, std::string_view s, bool allowInterrupts) } } -std::string readLine(HANDLE handle, bool eofOk) +std::string readLine(HANDLE handle, bool eofOk, char terminator) { std::string s; while (1) { @@ -76,7 +76,7 @@ std::string readLine(HANDLE handle, bool eofOk) else throw EndOfFile("unexpected EOF reading a line"); } else { - if (ch == '\n') + if (ch == terminator) return s; s += ch; }