Fossil SCM
Fix the blob_read_from_file() function so that it works with files larger than 2GiB.
Commit
837333fc8c605b0c7a5a64e6f0381c6372dbb857f78ebd625efceedd47e47fba
Parent
699fca172dbd582…
2 files changed
+2
-2
+1
-1
+2
-2
| --- src/blob.c | ||
| +++ src/blob.c | ||
| @@ -789,12 +789,12 @@ | ||
| 789 | 789 | ** Any prior content of the blob is discarded, not freed. |
| 790 | 790 | ** |
| 791 | 791 | ** Return the number of bytes read. Calls fossil_fatal() on error (i.e. |
| 792 | 792 | ** it exit()s and does not return). |
| 793 | 793 | */ |
| 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; | |
| 796 | 796 | FILE *in; |
| 797 | 797 | if( zFilename==0 || zFilename[0]==0 |
| 798 | 798 | || (zFilename[0]=='-' && zFilename[1]==0) ){ |
| 799 | 799 | return blob_read_from_channel(pBlob, stdin, -1); |
| 800 | 800 | } |
| 801 | 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 | 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 @@ | ||
| 796 | 796 | /* |
| 797 | 797 | ** Do a file-by-file comparison of the content of the repository and |
| 798 | 798 | ** the working check-out on disk. Report any errors. |
| 799 | 799 | */ |
| 800 | 800 | void vfile_compare_repository_to_disk(int vid){ |
| 801 | - int rc; | |
| 801 | + sqlite3_int64 rc; | |
| 802 | 802 | Stmt q; |
| 803 | 803 | Blob disk, repo; |
| 804 | 804 | char *zOut; |
| 805 | 805 | |
| 806 | 806 | db_must_be_within_tree(); |
| 807 | 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 | 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 |