mirror of
https://github.com/gbdev/rgbds.git
synced 2026-10-06 04:05:38 +00:00
Process the last line of textual palette specs even without a trailing newline
Fixes #1519
This commit is contained in:
1 parent
e1ac7f389d
commit
86bf289452
1 file changed
+2
-1
@@ -211,11 +211,12 @@ static T readLE(U const *bytes) {
|
||||
[[gnu::warn_unused_result]] // Ignoring EOF is a bad idea.
|
||||
static bool
|
||||
readLine(std::filebuf &file, std::string &buffer) {
|
||||
assume(buffer.empty());
|
||||
// TODO: maybe this can be optimized to bulk reads?
|
||||
for (;;) {
|
||||
auto c = file.sbumpc();
|
||||
if (c == std::filebuf::traits_type::eof()) {
|
||||
return false;
|
||||
return !buffer.empty();
|
||||
}
|
||||
if (c == '\n') {
|
||||
// Discard a trailing CRLF
|
||||
|
||||
Reference in new issue
Block a user