infused / dbf

DBF is a small, fast Ruby library for reading dBase, xBase, Clipper, and FoxPro database files.
http://rdoc.info/projects/infused/dbf
MIT License
262 stars 88 forks source link

Allow zero length column #68

Closed OndroNR closed 9 years ago

OndroNR commented 9 years ago

Hi, we have DBF file with column that have zero column length and no data in it. I have altered DBF::Column#initialize to accept zero length columns. All tests passes.

infused commented 9 years ago

What is the column type of the 0 length column? Also, what is the version of the dbf file (table.version)?

OndroNR commented 9 years ago

Numeric. There are other Character zero length columns after this one, that would possibly fail. Version is "03" (table.version), dBASE III (DBFView)

infused commented 9 years ago

What is the expected output of a zero length column? I'm thinking that the value for any zero length column should be nil regardless of the column type. Do you agree?

OndroNR commented 9 years ago

Nil should be fine as the value is missing.

infused commented 9 years ago

Thanks for contributing this work! I've released version 2.0.10 that includes these changes.

OndroNR commented 9 years ago

Thanks to you as well :)