From 0638af6825c2bf610c22fd13c90e5aa926448260 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 2 May 2013 09:20:54 -0700 Subject: [PATCH] Use agi::line_iterator for loading keyframe files line_iterator supports Windows newlines on non-Windows platforms, unlike istream_iterator. --- aegisub/libaegisub/common/keyframe.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aegisub/libaegisub/common/keyframe.cpp b/aegisub/libaegisub/common/keyframe.cpp index fa98c41ca..91bee0957 100644 --- a/aegisub/libaegisub/common/keyframe.cpp +++ b/aegisub/libaegisub/common/keyframe.cpp @@ -37,15 +37,15 @@ std::vector agi_keyframes(std::istream &file) { file >> fps_str; file >> fps; - return std::vector(std::istream_iterator(file), std::istream_iterator()); + return std::vector(agi::line_iterator(file), agi::line_iterator()); } std::vector other_keyframes(std::istream &file, char (*func)(std::string const&)) { int count = 0; std::vector ret; agi::line_iterator end; - for (agi::line_iterator iter(file); iter != end; ++iter) { - char c = tolower(func(*iter)); + for (auto line : agi::line_iterator(file)) { + char c = tolower(func(line)); if (c == 'i') ret.push_back(count++); else if (c == 'p' || c == 'b')