Procházet zdrojové kódy

Spreadsheet: Ignore extra empty lines after the rows

We now ignore the last CRLF in e.g.
```csv
aaa,bbb,ccc CRLF
zzz,yyy,xxx CRLF
```
AnotherTest před 4 roky
rodič
revize
ccf84a4709
1 změnil soubory, kde provedl 6 přidání a 0 odebrání
  1. 6 0
      Userland/Applications/Spreadsheet/Readers/XSV.cpp

+ 6 - 0
Userland/Applications/Spreadsheet/Readers/XSV.cpp

@@ -71,6 +71,12 @@ void XSV::parse()
     while (!has_error() && !m_lexer.is_eof())
     while (!has_error() && !m_lexer.is_eof())
         m_rows.append(read_row());
         m_rows.append(read_row());
 
 
+    // Read and drop any extra lines at the end.
+    while (!m_lexer.is_eof()) {
+        if (!m_lexer.consume_specific("\r\n") && !m_lexer.consume_specific('\n'))
+            break;
+    }
+
     if (!m_lexer.is_eof())
     if (!m_lexer.is_eof())
         set_error(ReadError::DataPastLogicalEnd);
         set_error(ReadError::DataPastLogicalEnd);
 }
 }