Skip to content

Commit

Permalink
Fix implementation and test
Browse files Browse the repository at this point in the history
  • Loading branch information
quinnj committed Jan 31, 2020
1 parent 4ce02d5 commit 4164e5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/CSV.jl
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ function file(source,
if footerskip > 0 && len > 0
lastbyte = buf[end]
endpos = (lastbyte == UInt8('\r') || lastbyte == UInt8('\n')) +
lastbyte == UInt8('\n') && buf[end - 1] == UInt8('\r')
(lastbyte == UInt8('\n') && buf[end - 1] == UInt8('\r'))
revlen = skiptorow(ReversedBuf(buf), 1 + endpos, len, oq, eq, cq, 0, footerskip) - 2
len -= revlen
debug && println("adjusted for footerskip, len = $(len + revlen - 1) => $len")
Expand Down
2 changes: 1 addition & 1 deletion test/basics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ df = CSV.read(IOBuffer("x\n01:02:03\n\n04:05:06\n"), delim=',')

# 566
f = CSV.File(IOBuffer("x\r\n1\r\n2\r\n3\r\n4\r\n5\r\n"), footerskip=3)
@test length(f) == 3
@test length(f) == 2
@test f[1][1] == 1

end

0 comments on commit 4164e5f

Please sign in to comment.