Skip to content

Fails to parse last line of CSV if it isn't terminated with a new line #10

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. Create a CSV that doesn't have a new line at the bottom
2. Attempt to parse
3. Notice that the last column of the last row isn't read

What is the expected output? What do you see instead?
Each and every row/column correctly parsed.

What version of the product are you using? On what operating system?
Windows 7 Professional 64 bit

Please provide any additional information below.
This can be fixed via the attached patch. Essentially, when the last line is 
read (EOF character is detected), the code should increment current position, 
as we then allocate a buffer based on the line length, and as later code 
expects there to be a line terminator, we add the line terminator in in the 
second from last character (last character is NULL terminator, second from last 
EOL and previous characters are read from file).

Original issue reported on code.google.com by [email protected] on 24 Oct 2014 at 9:56

Attachments:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions