prc-tools CVS: prc-tools jmarshall
Brought to you by:
jmarshall
|
From: John M. <jma...@us...> - 2004-07-06 23:11:12
|
CVSROOT: /cvsroot/prc-tools Module name: prc-tools Changes by: jmarshall 04/07/06 16:11:04 Modified files: tools : build-prc.cpp def.y palmdev-prep.c trapfilt.c utils.c utils.h Log message: Introduce file_length() and file_exists() utilities, and use them instead of using raw struct stat in build-prc.cpp and palmdev-prep.c. Using file_length(), slurp_file_as_datablock can now read directly into its Datablock. After that change, all the users of slurp_file() are using it to read text files. So replace it with slurp_text_file(), and implement that so that it checks for EOF directly rather than checking that it read exactly as many characters as it expected to. This fixes a bug on CR-LF filesystems where the number of characters read (which includes \n characters) is less than the number of bytes in the file (which includes CR-LF byte sequences). |