diff --git a/csv.lisp b/csv.lisp index da26e34..39fdc51 100644 --- a/csv.lisp +++ b/csv.lisp @@ -238,12 +238,7 @@ Be careful to not skip a separator, as it could be e.g. a tab!" (setf had-quotes nil) (when *skip-whitespace* (accept-spaces stream)) - (cond - ((and (null fields) - (or (accept-eol stream) (accept-eof stream))) - (done)) - (t - (do-field-start)))) + (do-field-start)) (do-field-start () (cond ((accept-separator stream) diff --git a/test.lisp b/test.lisp index 3bba1bf..e92514a 100644 --- a/test.lisp +++ b/test.lisp @@ -61,8 +61,25 @@ ") (test-read-write " " - '(()) + '(("")) +lf+) (test-both "" '())) + +(deftest test-empty-field () + (test-read + "a + +c" + '(("a") + ("") + ("c"))) + (test-read + "a +" + '(("a"))) + (test-read + "a + " + '(("a") (""))))