Fossil SCM
In svn_read_headers(), end the dump only when nothing is left to read. A dump cut off inside the first header line of a record ended the import with success and no message; it is now reported as a bad header line.
Commit
a7881ab66e45fb4ed9b9e82d46901d3cd90a5c55a3eba8c1a188deed4eaae708
Parent
2a02aabd9a043f9…
1 file changed
+3
-4
+3
-4
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -920,17 +920,16 @@ | ||
| 920 | 920 | return (int)v; |
| 921 | 921 | } |
| 922 | 922 | |
| 923 | 923 | static int svn_read_headers(FILE *pIn, SvnRecord *rec){ |
| 924 | 924 | char zLine[1000]; |
| 925 | + char *z; | |
| 925 | 926 | |
| 926 | 927 | rec->aHeaders = 0; |
| 927 | 928 | rec->nHeaders = 0; |
| 928 | - while( fgets(zLine, sizeof(zLine), pIn) ){ | |
| 929 | - if( zLine[0]!='\n' ) break; | |
| 930 | - } | |
| 931 | - if( feof(pIn) ) return 0; | |
| 929 | + while( (z = fgets(zLine, sizeof(zLine), pIn))!=0 && zLine[0]=='\n' ){} | |
| 930 | + if( z==0 ) return 0; | |
| 932 | 931 | do{ |
| 933 | 932 | char *sep; |
| 934 | 933 | if( zLine[0]=='\n' ) break; |
| 935 | 934 | rec->nHeaders += 1; |
| 936 | 935 | rec->aHeaders = fossil_realloc(rec->aHeaders, |
| 937 | 936 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -920,17 +920,16 @@ | |
| 920 | return (int)v; |
| 921 | } |
| 922 | |
| 923 | static int svn_read_headers(FILE *pIn, SvnRecord *rec){ |
| 924 | char zLine[1000]; |
| 925 | |
| 926 | rec->aHeaders = 0; |
| 927 | rec->nHeaders = 0; |
| 928 | while( fgets(zLine, sizeof(zLine), pIn) ){ |
| 929 | if( zLine[0]!='\n' ) break; |
| 930 | } |
| 931 | if( feof(pIn) ) return 0; |
| 932 | do{ |
| 933 | char *sep; |
| 934 | if( zLine[0]=='\n' ) break; |
| 935 | rec->nHeaders += 1; |
| 936 | rec->aHeaders = fossil_realloc(rec->aHeaders, |
| 937 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -920,17 +920,16 @@ | |
| 920 | return (int)v; |
| 921 | } |
| 922 | |
| 923 | static int svn_read_headers(FILE *pIn, SvnRecord *rec){ |
| 924 | char zLine[1000]; |
| 925 | char *z; |
| 926 | |
| 927 | rec->aHeaders = 0; |
| 928 | rec->nHeaders = 0; |
| 929 | while( (z = fgets(zLine, sizeof(zLine), pIn))!=0 && zLine[0]=='\n' ){} |
| 930 | if( z==0 ) return 0; |
| 931 | do{ |
| 932 | char *sep; |
| 933 | if( zLine[0]=='\n' ) break; |
| 934 | rec->nHeaders += 1; |
| 935 | rec->aHeaders = fossil_realloc(rec->aHeaders, |
| 936 |