Fossil SCM

Roll back [195571aa79e79f0] because it turns out that the duplicate init is necessary due to how manifest_parse() works. This fixes the all-attachments-save-as-empty bug.

stephan 2026-06-08 13:04 UTC forum-editor-2026
Commit febb8c155b77f970430e7488a2d82993070c32aefb6ca1d716e9a2e06a2594c8
1 file changed +6 -4
+6 -4
--- src/attach.c
+++ src/attach.c
@@ -538,17 +538,19 @@
538538
int addCompress = 0;
539539
Manifest *pManifest;
540540
541541
db_begin_transaction();
542542
blob_init(&content, aContent, szContent);
543
- if( (pManifest = manifest_parse(&content, 0, 0)) ){
544
- manifest_destroy(pManifest);
543
+ pManifest = manifest_parse(&content, 0, 0);
544
+ addCompress = pManifest!=0;
545
+ manifest_destroy(pManifest);
546
+ blob_init(&content, aContent, szContent);
547
+ if( addCompress ){
545548
blob_compress(&content, &content);
546
- addCompress = 1;
547549
}
548550
rid = content_put_ex(&content, 0, 0, 0, needModerator);
549
- zUUID = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
551
+ zUUID = rid_to_uuid(rid);
550552
blob_zero(&manifest);
551553
for(i=n=0; zName[i]; i++){
552554
if( zName[i]=='/' || zName[i]=='\\' ) n = i+1;
553555
}
554556
zName += n;
555557
--- src/attach.c
+++ src/attach.c
@@ -538,17 +538,19 @@
538 int addCompress = 0;
539 Manifest *pManifest;
540
541 db_begin_transaction();
542 blob_init(&content, aContent, szContent);
543 if( (pManifest = manifest_parse(&content, 0, 0)) ){
544 manifest_destroy(pManifest);
 
 
 
545 blob_compress(&content, &content);
546 addCompress = 1;
547 }
548 rid = content_put_ex(&content, 0, 0, 0, needModerator);
549 zUUID = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
550 blob_zero(&manifest);
551 for(i=n=0; zName[i]; i++){
552 if( zName[i]=='/' || zName[i]=='\\' ) n = i+1;
553 }
554 zName += n;
555
--- src/attach.c
+++ src/attach.c
@@ -538,17 +538,19 @@
538 int addCompress = 0;
539 Manifest *pManifest;
540
541 db_begin_transaction();
542 blob_init(&content, aContent, szContent);
543 pManifest = manifest_parse(&content, 0, 0);
544 addCompress = pManifest!=0;
545 manifest_destroy(pManifest);
546 blob_init(&content, aContent, szContent);
547 if( addCompress ){
548 blob_compress(&content, &content);
 
549 }
550 rid = content_put_ex(&content, 0, 0, 0, needModerator);
551 zUUID = rid_to_uuid(rid);
552 blob_zero(&manifest);
553 for(i=n=0; zName[i]; i++){
554 if( zName[i]=='/' || zName[i]=='\\' ) n = i+1;
555 }
556 zName += n;
557

Keyboard Shortcuts

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