Fossil SCM

Checkin [188ffef2] inadvertently caused one particular graceful failure to degrade to a non-graceful failure (a failed assert()). This checkin resolves that.

stephan 2021-02-24 04:59 trunk
Commit 7a985a3d2c570b1e34b55be3e123faa8564f1ba23059b3a929d81ac4bcf85cf8
1 file changed +9
--- src/content.c
+++ src/content.c
@@ -827,10 +827,19 @@
827827
Blob bestDelta; /* Best delta seen so far */
828828
int bestSrc = 0; /* Which aSrc is the source of the best delta */
829829
int rc = 0; /* Value to return */
830830
int i; /* Loop variable for aSrc[] */
831831
832
+ /*
833
+ ** Historically this routine gracefully ignored the rid 0, but the
834
+ ** addition of a call to content_is_available() in [188ffef2] caused
835
+ ** rid 0 to trigger an assert via bag_find(). Rather than track down
836
+ ** all such calls (e.g. the one via /technoteedit), we'll continue
837
+ ** to gracefully ignore rid 0 here.
838
+ */
839
+ if( 0==rid ) return 0;
840
+
832841
/* If rid is already a child (a delta) of some other artifact, return
833842
** immediately if the force flags is false
834843
*/
835844
if( !force && delta_source_rid(rid)>0 ) return 0;
836845
837846
--- src/content.c
+++ src/content.c
@@ -827,10 +827,19 @@
827 Blob bestDelta; /* Best delta seen so far */
828 int bestSrc = 0; /* Which aSrc is the source of the best delta */
829 int rc = 0; /* Value to return */
830 int i; /* Loop variable for aSrc[] */
831
 
 
 
 
 
 
 
 
 
832 /* If rid is already a child (a delta) of some other artifact, return
833 ** immediately if the force flags is false
834 */
835 if( !force && delta_source_rid(rid)>0 ) return 0;
836
837
--- src/content.c
+++ src/content.c
@@ -827,10 +827,19 @@
827 Blob bestDelta; /* Best delta seen so far */
828 int bestSrc = 0; /* Which aSrc is the source of the best delta */
829 int rc = 0; /* Value to return */
830 int i; /* Loop variable for aSrc[] */
831
832 /*
833 ** Historically this routine gracefully ignored the rid 0, but the
834 ** addition of a call to content_is_available() in [188ffef2] caused
835 ** rid 0 to trigger an assert via bag_find(). Rather than track down
836 ** all such calls (e.g. the one via /technoteedit), we'll continue
837 ** to gracefully ignore rid 0 here.
838 */
839 if( 0==rid ) return 0;
840
841 /* If rid is already a child (a delta) of some other artifact, return
842 ** immediately if the force flags is false
843 */
844 if( !force && delta_source_rid(rid)>0 ) return 0;
845
846

Keyboard Shortcuts

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