diff --git a/Doc/Manual/Extending.html b/Doc/Manual/Extending.html index 5749f37ce..8e5dfb18b 100644 --- a/Doc/Manual/Extending.html +++ b/Doc/Manual/Extending.html @@ -1132,6 +1132,11 @@ DOH_REPLACE_FIRST - Replace first occurrence only. Returns the number of replacements made (if any).

+

+At most one of DOH_REPLACE_ANY and DOH_REPLACE_FIRST should be specified. +DOH_REPLACE_ANY is the default if neither is specified. +

+

40.5.2 Hashes

diff --git a/Source/CParse/templ.c b/Source/CParse/templ.c index 2f38cc2c2..9bd5a084c 100644 --- a/Source/CParse/templ.c +++ b/Source/CParse/templ.c @@ -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; } diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx index 1476ddba5..ca5ec8c3c 100644 --- a/Source/Modules/main.cxx +++ b/Source/Modules/main.cxx @@ -477,7 +477,7 @@ static void getoptions(int argc, char *argv[]) { Swig_mark_arg(i); } else if (strncmp(argv[i], "-D", 2) == 0) { String *d = NewString(argv[i] + 2); - Replace(d, "=", " ", DOH_REPLACE_ANY | DOH_REPLACE_FIRST); + Replace(d, "=", " ", DOH_REPLACE_FIRST); Preprocessor_define((DOH *) d, 0); Delete(d); // Create a symbol diff --git a/Source/Modules/ocaml.cxx b/Source/Modules/ocaml.cxx index caa9725c0..a36912ab7 100644 --- a/Source/Modules/ocaml.cxx +++ b/Source/Modules/ocaml.cxx @@ -407,7 +407,7 @@ public: printf("Fatal error. SwigType_del_pointer applied to non-pointer.\n"); abort(); } - Replace(t, "r.", "", DOH_REPLACE_ANY | DOH_REPLACE_FIRST); + Replace(t, "r.", "", DOH_REPLACE_FIRST); } void oc_SwigType_del_array(SwigType *t) {