소스 검색

LibCore: Fix bug in IODevice::LineIterator causing skipped lines

Sahan Fernando 3 년 전
부모
커밋
6d948c1a92
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      Userland/Libraries/LibCore/IODevice.cpp

+ 3 - 1
Userland/Libraries/LibCore/IODevice.cpp

@@ -304,7 +304,9 @@ LineIterator::LineIterator(IODevice& device, bool is_end)
     : m_device(device)
     : m_device(device)
     , m_is_end(is_end)
     , m_is_end(is_end)
 {
 {
-    ++*this;
+    if (!m_is_end) {
+        ++*this;
+    }
 }
 }
 
 
 bool LineIterator::at_end() const
 bool LineIterator::at_end() const