]> Cypherpunks.ru repositories - gorecfile.git/blobdiff - r.go
Workaround for backslash in multilines
[gorecfile.git] / r.go
diff --git a/r.go b/r.go
index 1cd3cb6071a6c6d345f108561dbeb5fb4ee95f71..5de2a455a4f5d0c315c406bd1d1aa3a56c3a375e 100644 (file)
--- a/r.go
+++ b/r.go
@@ -80,7 +80,9 @@ func (r *Reader) Next() ([]Field, error) {
                text = r.scanner.Text()
 
                if continuation {
-                       if text[len(text)-1] == '\\' {
+                       if len(text) == 0 {
+                               continuation = false
+                       } else if text[len(text)-1] == '\\' {
                                lines = append(lines, text[:len(text)-1])
                        } else {
                                lines = append(lines, text)