@@ -242,7 +242,7 @@ void add_snippet_ids(match_data_t *match, char *snippet_ids, long from, long to)
242242 * @param scan[out] pointer to scan data
243243 * @return hits
244244 */
245- int ranges_assemble (matchmap_range * ranges , char * line_ranges , char * oss_ranges , int min_match_lines , int ranges_number )
245+ int ranges_assemble (matchmap_range * ranges , char * line_ranges , char * oss_ranges , int min_range_lines , int ranges_number )
246246{
247247 int out = 0 ;
248248 /* Walk ranges */
@@ -257,7 +257,7 @@ int ranges_assemble(matchmap_range *ranges, char *line_ranges, char *oss_ranges,
257257 if (from == 0 )
258258 from = 1 ;
259259 //discard snippets below the limit of detection
260- if (to - from < min_match_lines )
260+ if (to - from < min_range_lines )
261261 continue ;
262262 /* Add commas unless it is the first range */
263263 if (* line_ranges )
@@ -290,10 +290,11 @@ int range_comp(const void *a, const void *b)
290290 * @brief Join overlapping ranges
291291 * @param ranges ranges list to process
292292 */
293- matchmap_range * ranges_join_overlapping (matchmap_range * ranges , int size , int range_tolerance , bool fixed_ranges )
293+ matchmap_range * ranges_join_overlapping (matchmap_range * ranges , int size , int range_tolerance , bool dynamic_ranges )
294294{
295295 int out_size = MATCHMAP_RANGES ;
296- if (fixed_ranges )
296+ dynamic_ranges = false; // TODO: disable dynamic ranges for now
297+ if (dynamic_ranges )
297298 out_size = size ;
298299
299300 matchmap_range * out_ranges = calloc (out_size , sizeof (matchmap_range ));
@@ -321,7 +322,7 @@ matchmap_range * ranges_join_overlapping(matchmap_range *ranges, int size, int r
321322 else
322323 {
323324 out_ranges_index ++ ;
324- if (out_ranges_index == MATCHMAP_RANGES && !fixed_ranges )
325+ if (out_ranges_index == MATCHMAP_RANGES && !dynamic_ranges )
325326 break ;
326327 out_ranges [out_ranges_index ].from = ranges [i ].from ;
327328 out_ranges [out_ranges_index ].to = ranges [i ].to ;
@@ -330,7 +331,7 @@ matchmap_range * ranges_join_overlapping(matchmap_range *ranges, int size, int r
330331 processed ++ ;
331332 }
332333 }
333- if (fixed_ranges )
334+ if (dynamic_ranges )
334335 break ;
335336 tolerance *= 2 ;
336337 }
0 commit comments