-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle input file line endings #183
Handle input file line endings #183
Conversation
If we go for this, could you add some tests? |
Sure! I'll work on it and let you know.
…On Sun, 2024-09-29 at 12:17 -0700, Mohab Safey El Din wrote:
If we go for this, could you add some tests?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Let's wait for CI to complete, but up to some minor fix, but this now should work with several tests added (3 files with DOS endings ; 1 file with DOS endings + no end of line in last line). In case this can be re-used: this contains a function that tests that two |
@vneiger So is this ready to be merged or do we expect some fix? |
It is ready for review. (The "up to some minor fix" was in case CI had complained, I should have made that clear.) |
This solves #182.
This also does minor cleaning in two functions of iofiles, the only difference in behaviour should be that
get_nvars
returns-1
on failure (it used to return 0).Before merging: related to the FIXME's I put in
get_data_from_file
, shouldn't this function fail as soon as one of its "data retrieval" components fail?Also, in this function, is it really necessary to allocate 1073741824 bytes (1GB) for
line
? I assume only a very small part of it will ever be used so it will sit mostly in virtual memory, but still... say we read line by line using getline (which is not exactly the case currently), we could simply let getline do the necessary reallocs.