Fossil

Diff
Login

Differences From Artifact [84dbba2fcd]:

To Artifact [1acc8925d8]:


2608
2609
2610
2611
2612
2613
2614




2615







2616
2617
2618
2619
2620
2621
2622
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618

2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632







+
+
+
+
-
+
+
+
+
+
+
+







    }

    /* move redundant elements to the end of array and truncate/resize */
    qsort(fn, rndr.notes.nLbled, sizeof(struct footnote), cmp_footnote_id);
    i = rndr.notes.nLbled;
    while( i && !blob_size(&fn[i-1].id) ){ i--; }
    rndr.notes.nLbled = i;
    blob_resize( &rndr.notes.all, i*sizeof(struct footnote) );

    /* FIXME: It was expected to work via truncation:
     *
    blob_truncate( &rndr.notes.all, i*sizeof(struct footnote) );
     *    blob_truncate( &rndr.notes.all, i*sizeof(struct footnote) );
     *
     * but that way it crashes with
     *
     *    free(): double free detected in tcache 2
     *
     * This is strange. */
  }
  assert( COUNT_FOOTNOTES(&rndr.notes.all) == rndr.notes.nLbled );
  fn = CAST_AS_FOOTNOTES(&rndr.notes.all);
  for(i=0; i<rndr.notes.nLbled; i++){
    fn[i].index = i;
  }
  assert( rndr.notes.nMarks==0 );