diff --git a/libmamba/src/specs/match_spec.cpp b/libmamba/src/specs/match_spec.cpp index fde395610..6826f2c2d 100644 --- a/libmamba/src/specs/match_spec.cpp +++ b/libmamba/src/specs/match_spec.cpp @@ -505,7 +505,7 @@ namespace mamba::specs auto MatchSpec::parse(std::string_view str) -> expected_parse_t { // Remove comments, i.e. everything after ` #` (space included) - if (const auto idx = str.find('#'); idx != std::string::npos && str[idx - 1] == ' ') + if (const auto idx = str.find(" #"); idx != std::string::npos) { str = str.substr(0, idx); }