The current implementation of OpamFilename.starts_with dir file is a substring check. It can return true even when the dirname of dir is a substring of the dirname of file.
# OpamFilename.starts_with (OpamFilename.Dir.of_string "/a/path") (OpamFilename.of_string "/a/path/to");;
- : bool = true
# OpamFilename.starts_with (OpamFilename.Dir.of_string "/a/path") (OpamFilename.of_string "/a/path-xxx/to");;
- : bool = true
# OpamFilename.starts_with (OpamFilename.Dir.of_string "/a/path/") (OpamFilename.of_string "/a/path-xxx/to");;
- : bool = true
The current implementation of
OpamFilename.starts_with dir fileis a substring check. It can return true even when the dirname ofdiris a substring of the dirname offile.