From 2b4b48b5cb31fdc6e60f289733aa48261547855f Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Sun, 28 Apr 2024 12:19:49 +0100 Subject: [PATCH] Fix wrong split function The cases of this match were the wrong way around. Combined with the previous fixes, this finally addressed #5838. --- src/state/opamEnv.ml | 4 ++-- tests/reftests/env.win32.test | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/state/opamEnv.ml b/src/state/opamEnv.ml index 2f9beb12460..0ae590b3d96 100644 --- a/src/state/opamEnv.ml +++ b/src/state/opamEnv.ml @@ -156,9 +156,9 @@ let split_var ~(sepfmt:sep_path_format) var value = in let sep = OpamTypesBase.char_of_separator separator in match format with - | Target_quoted | Host_quoted -> - List.map (fun s -> (s, s, sep)) (OpamStd.String.split value sep) | Target | Host -> + List.map (fun s -> (s, s, sep)) (OpamStd.String.split value sep) + | Target_quoted | Host_quoted -> let split_path_variable path = let length = String.length path in let rec f acc index current current_raw last normal = diff --git a/tests/reftests/env.win32.test b/tests/reftests/env.win32.test index 0b4f3216f0a..4903433f138 100644 --- a/tests/reftests/env.win32.test +++ b/tests/reftests/env.win32.test @@ -27,6 +27,7 @@ set "PATH=${BASEDIR}/OPAM/rewriting/bin;C:\Devel\bin1;C:\Devel\bin2;"C:\Devel\bi ### opam env | grep MANPATH MANPATH=':"${BASEDIR}/OPAM/rewriting/man"'; export MANPATH; ### opam exec -- opam env --revert | grep MANPATH +MANPATH=''; export MANPATH; ### : Tests forward and backslash rewriting on revert ### : This sequence of updates is what presently happens with the compiler ###