Fossil SCM

Fix the blob_read_from_file() function so that it works with files larger than 2GiB.

drh 2017-06-13 04:45 trunk
Commit 837333fc8c605b0c7a5a64e6f0381c6372dbb857f78ebd625efceedd47e47fba
2 files changed +2 -2 +1 -1
+2 -2
--- src/blob.c
+++ src/blob.c
@@ -789,12 +789,12 @@
789789
** Any prior content of the blob is discarded, not freed.
790790
**
791791
** Return the number of bytes read. Calls fossil_fatal() on error (i.e.
792792
** it exit()s and does not return).
793793
*/
794
-int blob_read_from_file(Blob *pBlob, const char *zFilename){
795
- int size, got;
794
+sqlite3_int64 blob_read_from_file(Blob *pBlob, const char *zFilename){
795
+ sqlite3_int64 size, got;
796796
FILE *in;
797797
if( zFilename==0 || zFilename[0]==0
798798
|| (zFilename[0]=='-' && zFilename[1]==0) ){
799799
return blob_read_from_channel(pBlob, stdin, -1);
800800
}
801801
--- src/blob.c
+++ src/blob.c
@@ -789,12 +789,12 @@
789 ** Any prior content of the blob is discarded, not freed.
790 **
791 ** Return the number of bytes read. Calls fossil_fatal() on error (i.e.
792 ** it exit()s and does not return).
793 */
794 int blob_read_from_file(Blob *pBlob, const char *zFilename){
795 int size, got;
796 FILE *in;
797 if( zFilename==0 || zFilename[0]==0
798 || (zFilename[0]=='-' && zFilename[1]==0) ){
799 return blob_read_from_channel(pBlob, stdin, -1);
800 }
801
--- src/blob.c
+++ src/blob.c
@@ -789,12 +789,12 @@
789 ** Any prior content of the blob is discarded, not freed.
790 **
791 ** Return the number of bytes read. Calls fossil_fatal() on error (i.e.
792 ** it exit()s and does not return).
793 */
794 sqlite3_int64 blob_read_from_file(Blob *pBlob, const char *zFilename){
795 sqlite3_int64 size, got;
796 FILE *in;
797 if( zFilename==0 || zFilename[0]==0
798 || (zFilename[0]=='-' && zFilename[1]==0) ){
799 return blob_read_from_channel(pBlob, stdin, -1);
800 }
801
+1 -1
--- src/vfile.c
+++ src/vfile.c
@@ -796,11 +796,11 @@
796796
/*
797797
** Do a file-by-file comparison of the content of the repository and
798798
** the working check-out on disk. Report any errors.
799799
*/
800800
void vfile_compare_repository_to_disk(int vid){
801
- int rc;
801
+ sqlite3_int64 rc;
802802
Stmt q;
803803
Blob disk, repo;
804804
char *zOut;
805805
806806
db_must_be_within_tree();
807807
--- src/vfile.c
+++ src/vfile.c
@@ -796,11 +796,11 @@
796 /*
797 ** Do a file-by-file comparison of the content of the repository and
798 ** the working check-out on disk. Report any errors.
799 */
800 void vfile_compare_repository_to_disk(int vid){
801 int rc;
802 Stmt q;
803 Blob disk, repo;
804 char *zOut;
805
806 db_must_be_within_tree();
807
--- src/vfile.c
+++ src/vfile.c
@@ -796,11 +796,11 @@
796 /*
797 ** Do a file-by-file comparison of the content of the repository and
798 ** the working check-out on disk. Report any errors.
799 */
800 void vfile_compare_repository_to_disk(int vid){
801 sqlite3_int64 rc;
802 Stmt q;
803 Blob disk, repo;
804 char *zOut;
805
806 db_must_be_within_tree();
807

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button