Fossil SCM

Caught more instances of the previous commit's fix.

stephan 2021-09-08 11:11 trunk
Commit 992b62fa8b85aa0882d74a5b5349e0a4015afc6cfb5b257541338f2a2c5a8aac
1 file changed +15 -7
+15 -7
--- src/manifest.c
+++ src/manifest.c
@@ -353,11 +353,13 @@
353353
md5sum_step_text(z, n-35);
354354
zHash = md5sum_finish(0);
355355
if( memcmp(&z[n-33], zHash, 32)==0 ){
356356
return 1;
357357
}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
+ }
359361
return 2;
360362
}
361363
}
362364
363365
/*
@@ -488,11 +490,13 @@
488490
if( !isRepeat ) g.parseCnt[0]++;
489491
z = blob_materialize(pContent);
490492
n = blob_size(pContent);
491493
if( n<=0 || z[n-1]!='\n' ){
492494
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
+ }
494498
return 0;
495499
}
496500
497501
/* Strip off the PGP signature if there is one.
498502
*/
@@ -1124,18 +1128,22 @@
11241128
11251129
manifest_syntax_error:
11261130
{
11271131
char *zUuid = rid_to_uuid(rid);
11281132
if( zUuid ){
1129
- blob_appendf(pErr, "artifact [%s] ", zUuid);
1133
+ if(pErr!=0){
1134
+ blob_appendf(pErr, "artifact [%s] ", zUuid);
1135
+ }
11301136
fossil_free(zUuid);
11311137
}
11321138
}
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
+ }
11371145
}
11381146
md5sum_init();
11391147
manifest_destroy(p);
11401148
return 0;
11411149
}
11421150
--- 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

Keyboard Shortcuts

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