diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-27 10:56:36 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-27 10:56:36 -0800 |
commit | bea6637c03a90fbb9e754f5f63625fffb7cbaa69 (patch) | |
tree | 4aea00504c81bb357d4a6d6f9caf30e90e4d93cb /file.h | |
parent | 34d682416faee9c8beef8b0747d5f1587dea847c (diff) | |
download | subsurface-bea6637c03a90fbb9e754f5f63625fffb7cbaa69.tar.gz |
Import: always open and read the file before checking the filename extension
Most of the parsers will want the content in memory, so keep them
simple. The fact that the Suunto parser uses "libzip" that has to
re-open the file is annoying and causes us to re-open the file etc.
But it's the odd man out, so don't design the "open_by_filename()"
function around it. Pretty much everybody else will want to avoid
having to cook up their own IO routines.
Also, when reading the file, NUL-terminate the buffer. This allows us
to just treat text files as large strings if we want to, and doesn't
matter for binary files (we still pass in the length explicitly).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'file.h')
0 files changed, 0 insertions, 0 deletions