mirror of
https://github.com/libretro/ppsspp.git
synced 2025-01-31 13:52:21 +00:00
Fix headless auto-compare when expected have \r's.
This commit is contained in:
parent
be47964ff2
commit
5554865ebb
@ -53,7 +53,7 @@ struct BufferedLineReader {
|
||||
|
||||
void Fill() {
|
||||
while (valid_ < MAX_BUFFER && HasMoreLines()) {
|
||||
buffer_[valid_++] = ReadLine();
|
||||
buffer_[valid_++] = TrimNewlines(ReadLine());
|
||||
}
|
||||
}
|
||||
|
||||
@ -128,6 +128,14 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
static std::string TrimNewlines(const std::string &s) {
|
||||
size_t p = s.find_last_not_of("\r\n");
|
||||
if (p == s.npos) {
|
||||
return "";
|
||||
}
|
||||
return s.substr(0, p + 1);
|
||||
}
|
||||
|
||||
int valid_;
|
||||
std::string buffer_[MAX_BUFFER];
|
||||
const std::string data_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user