Fossil SCM
Caught more instances of the previous commit's fix.
Commit
992b62fa8b85aa0882d74a5b5349e0a4015afc6cfb5b257541338f2a2c5a8aac
Parent
65dbc19eaefefa9…
1 file changed
+15
-7
+15
-7
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -353,11 +353,13 @@ | ||
| 353 | 353 | md5sum_step_text(z, n-35); |
| 354 | 354 | zHash = md5sum_finish(0); |
| 355 | 355 | if( memcmp(&z[n-33], zHash, 32)==0 ){ |
| 356 | 356 | return 1; |
| 357 | 357 | }else{ |
| 358 | - blob_appendf(pErr, "incorrect Z-card cksum: expected %.32s", zHash); | |
| 358 | + if(pErr!=0){ | |
| 359 | + blob_appendf(pErr, "incorrect Z-card cksum: expected %.32s", zHash); | |
| 360 | + } | |
| 359 | 361 | return 2; |
| 360 | 362 | } |
| 361 | 363 | } |
| 362 | 364 | |
| 363 | 365 | /* |
| @@ -488,11 +490,13 @@ | ||
| 488 | 490 | if( !isRepeat ) g.parseCnt[0]++; |
| 489 | 491 | z = blob_materialize(pContent); |
| 490 | 492 | n = blob_size(pContent); |
| 491 | 493 | if( n<=0 || z[n-1]!='\n' ){ |
| 492 | 494 | blob_reset(pContent); |
| 493 | - blob_appendf(pErr, "%s", n ? "not terminated with \\n" : "zero-length"); | |
| 495 | + if(pErr!=0){ | |
| 496 | + blob_appendf(pErr, "%s", n ? "not terminated with \\n" : "zero-length"); | |
| 497 | + } | |
| 494 | 498 | return 0; |
| 495 | 499 | } |
| 496 | 500 | |
| 497 | 501 | /* Strip off the PGP signature if there is one. |
| 498 | 502 | */ |
| @@ -1124,18 +1128,22 @@ | ||
| 1124 | 1128 | |
| 1125 | 1129 | manifest_syntax_error: |
| 1126 | 1130 | { |
| 1127 | 1131 | char *zUuid = rid_to_uuid(rid); |
| 1128 | 1132 | if( zUuid ){ |
| 1129 | - blob_appendf(pErr, "artifact [%s] ", zUuid); | |
| 1133 | + if(pErr!=0){ | |
| 1134 | + blob_appendf(pErr, "artifact [%s] ", zUuid); | |
| 1135 | + } | |
| 1130 | 1136 | fossil_free(zUuid); |
| 1131 | 1137 | } |
| 1132 | 1138 | } |
| 1133 | - if( zErr ){ | |
| 1134 | - blob_appendf(pErr, "line %d: %s", lineNo, zErr); | |
| 1135 | - }else{ | |
| 1136 | - blob_appendf(pErr, "unknown error on line %d", lineNo); | |
| 1139 | + if(pErr!=0){ | |
| 1140 | + if( zErr ){ | |
| 1141 | + blob_appendf(pErr, "line %d: %s", lineNo, zErr); | |
| 1142 | + }else{ | |
| 1143 | + blob_appendf(pErr, "unknown error on line %d", lineNo); | |
| 1144 | + } | |
| 1137 | 1145 | } |
| 1138 | 1146 | md5sum_init(); |
| 1139 | 1147 | manifest_destroy(p); |
| 1140 | 1148 | return 0; |
| 1141 | 1149 | } |
| 1142 | 1150 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -353,11 +353,13 @@ | |
| 353 | md5sum_step_text(z, n-35); |
| 354 | zHash = md5sum_finish(0); |
| 355 | if( memcmp(&z[n-33], zHash, 32)==0 ){ |
| 356 | return 1; |
| 357 | }else{ |
| 358 | blob_appendf(pErr, "incorrect Z-card cksum: expected %.32s", zHash); |
| 359 | return 2; |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | /* |
| @@ -488,11 +490,13 @@ | |
| 488 | if( !isRepeat ) g.parseCnt[0]++; |
| 489 | z = blob_materialize(pContent); |
| 490 | n = blob_size(pContent); |
| 491 | if( n<=0 || z[n-1]!='\n' ){ |
| 492 | blob_reset(pContent); |
| 493 | blob_appendf(pErr, "%s", n ? "not terminated with \\n" : "zero-length"); |
| 494 | return 0; |
| 495 | } |
| 496 | |
| 497 | /* Strip off the PGP signature if there is one. |
| 498 | */ |
| @@ -1124,18 +1128,22 @@ | |
| 1124 | |
| 1125 | manifest_syntax_error: |
| 1126 | { |
| 1127 | char *zUuid = rid_to_uuid(rid); |
| 1128 | if( zUuid ){ |
| 1129 | blob_appendf(pErr, "artifact [%s] ", zUuid); |
| 1130 | fossil_free(zUuid); |
| 1131 | } |
| 1132 | } |
| 1133 | if( zErr ){ |
| 1134 | blob_appendf(pErr, "line %d: %s", lineNo, zErr); |
| 1135 | }else{ |
| 1136 | blob_appendf(pErr, "unknown error on line %d", lineNo); |
| 1137 | } |
| 1138 | md5sum_init(); |
| 1139 | manifest_destroy(p); |
| 1140 | return 0; |
| 1141 | } |
| 1142 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -353,11 +353,13 @@ | |
| 353 | md5sum_step_text(z, n-35); |
| 354 | zHash = md5sum_finish(0); |
| 355 | if( memcmp(&z[n-33], zHash, 32)==0 ){ |
| 356 | return 1; |
| 357 | }else{ |
| 358 | if(pErr!=0){ |
| 359 | blob_appendf(pErr, "incorrect Z-card cksum: expected %.32s", zHash); |
| 360 | } |
| 361 | return 2; |
| 362 | } |
| 363 | } |
| 364 | |
| 365 | /* |
| @@ -488,11 +490,13 @@ | |
| 490 | if( !isRepeat ) g.parseCnt[0]++; |
| 491 | z = blob_materialize(pContent); |
| 492 | n = blob_size(pContent); |
| 493 | if( n<=0 || z[n-1]!='\n' ){ |
| 494 | blob_reset(pContent); |
| 495 | if(pErr!=0){ |
| 496 | blob_appendf(pErr, "%s", n ? "not terminated with \\n" : "zero-length"); |
| 497 | } |
| 498 | return 0; |
| 499 | } |
| 500 | |
| 501 | /* Strip off the PGP signature if there is one. |
| 502 | */ |
| @@ -1124,18 +1128,22 @@ | |
| 1128 | |
| 1129 | manifest_syntax_error: |
| 1130 | { |
| 1131 | char *zUuid = rid_to_uuid(rid); |
| 1132 | if( zUuid ){ |
| 1133 | if(pErr!=0){ |
| 1134 | blob_appendf(pErr, "artifact [%s] ", zUuid); |
| 1135 | } |
| 1136 | fossil_free(zUuid); |
| 1137 | } |
| 1138 | } |
| 1139 | if(pErr!=0){ |
| 1140 | if( zErr ){ |
| 1141 | blob_appendf(pErr, "line %d: %s", lineNo, zErr); |
| 1142 | }else{ |
| 1143 | blob_appendf(pErr, "unknown error on line %d", lineNo); |
| 1144 | } |
| 1145 | } |
| 1146 | md5sum_init(); |
| 1147 | manifest_destroy(p); |
| 1148 | return 0; |
| 1149 | } |
| 1150 |