Clean up uses of Replace()

We were passing flags of DOH_REPLACE_ANY|DOH_REPLACE_FIRST in three
places, which doesn't make sense as those are mutually exclusive
concepts.  In the current implementation DOH_REPLACE_FIRST wins in
this situation, so replace with that and clarify the docs.
This commit is contained in:
Olly Betts 2022-02-06 09:54:21 +13:00
commit 9d7c962ee8
4 changed files with 8 additions and 3 deletions

View file

@ -249,7 +249,7 @@ String *partial_arg(String *s, String *p) {
}
prefix = NewStringWithSize(cp, (int)(c - cp));
newarg = Copy(s);
Replace(newarg, prefix, "", DOH_REPLACE_ANY | DOH_REPLACE_FIRST);
Replace(newarg, prefix, "", DOH_REPLACE_FIRST);
Delete(prefix);
return newarg;
}