Skip to content

Commit

Permalink
Fix wrong split function
Browse files Browse the repository at this point in the history
The cases of this match were the wrong way around.

Combined with the previous fixes, this finally addressed #5838.
  • Loading branch information
dra27 committed Apr 29, 2024
1 parent c4167f6 commit 2b4b48b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/state/opamEnv.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
1 change: 1 addition & 0 deletions tests/reftests/env.win32.test
Original file line number Diff line number Diff line change
Expand Up @@ -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
### <pkg:mixed-updates.1>
Expand Down

0 comments on commit 2b4b48b

Please sign in to comment.