From 4026a02edbd2dc0c1ed09ad35e852b42f14c6dcc Mon Sep 17 00:00:00 2001 From: Stephen Sherratt Date: Thu, 13 Apr 2023 21:17:11 +1000 Subject: [PATCH] Fix crash when prefix of "lock" subcommand is used --- CHANGES.md | 3 +++ cli/lock.ml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 114cdb747..f85b68a8e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -24,6 +24,9 @@ - Fix a failure when using opam-monorepo with an opam 2.2 root (#379, @kit-ty-kate) +- Fix assertion failure when prefix of "lock" subcommand is used (#???, + @gridbugs) + ### Removed ### Security diff --git a/cli/lock.ml b/cli/lock.ml index 2b03938ce..b4e1f68e1 100644 --- a/cli/lock.ml +++ b/cli/lock.ml @@ -515,7 +515,7 @@ let extract_source_config ~adjustment ~opam_monorepo_cwd ~opam_files let raw_cli_args () = match Array.to_list Sys.argv with - | _bin :: "lock" :: args -> args + | _bin :: prefix :: args when String.starts_with ~prefix "lock" -> args | _ -> assert false let run (`Root root) (`Recurse_opam recurse) (`Build_only build_only)