msolve icon indicating copy to clipboard operation
msolve copied to clipboard

Handle input file line endings

Open vneiger opened this issue 5 months ago • 3 comments

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.

vneiger avatar Sep 27 '24 18:09 vneiger