Skip to content

Commit

Permalink
Fix version equality without micro version in prefilter
Browse files Browse the repository at this point in the history
Fixes regression from ocaml-batteries-team#1124.
  • Loading branch information
sim642 committed Apr 14, 2024
1 parent 9024cb0 commit 7afb83c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build/prefilter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ let rec process_line loc line =
if Str.string_match version_re ver_string 0 then
let ver_maj = int_of_string (Str.matched_group 1 ver_string) in
let ver_min = try int_of_string (Str.matched_group 3 ver_string) with _ -> 0 in
let ver_mic = try int_of_string (Str.matched_group 5 ver_string) with _ -> 0 in
(* ver_mic defaults to micro (not 0) such that ##V=4.4## still matches 4.04.2 *)
let ver_mic = try int_of_string (Str.matched_group 5 ver_string) with _ -> micro in
cmp (major*10000+minor*100+micro) (ver_maj*10000+ver_min*100+ver_mic)
else if ver_string = "multicore" then
cmp (if has_domains ~extra then 5 else major) 5
Expand Down

0 comments on commit 7afb83c

Please sign in to comment.