From 553f4f8dcea90eb6241f7906479f5e7d24f02abd Mon Sep 17 00:00:00 2001 From: andybarcia Date: Fri, 19 Mar 2021 19:50:53 +0100 Subject: Improve error reporting when parsing CSV translation file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #46682. Also fix unit test suite to separate generic FileAccess CSV testing from using CSV as translation. And add more CSV translation tests. Co-authored-by: Rémi Verschelde --- core/io/file_access.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/io/file_access.cpp') diff --git a/core/io/file_access.cpp b/core/io/file_access.cpp index a6a1a224b3..b669afdc99 100644 --- a/core/io/file_access.cpp +++ b/core/io/file_access.cpp @@ -441,6 +441,11 @@ Vector FileAccess::get_csv_line(const String &p_delim) const { current += c; } } + + if (in_quote) { + WARN_PRINT(vformat("Reached end of file before closing '\"' in CSV file '%s'.", get_path())); + } + strings.push_back(current); return strings; -- cgit v1.2.3