sed: Perform case insensitive substitutions with "/i"

This commit is contained in:
Eli Youngs 2022-12-18 22:55:49 -08:00 committed by Andrew Kaster
parent 0dc65cd835
commit 96d3d3b0fe

View file

@ -90,6 +90,8 @@ static ErrorOr<SubstitutionCommand> parse_command(StringView command)
} else if (flag == "g"sv) {
// Allow multiple matches per line by un-setting the SingleMatch flag
options &= ~PosixFlags::SingleMatch;
} else if (flag == "i"sv || flag == "I"sv) {
options |= PosixFlags::Insensitive;
} else {
warnln("sed: Unsupported flag: {}", flag);
}