diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-05-10 00:59:45 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-05-10 00:59:45 (GMT) |
commit | da45d55a6ecff00ca714cbcf66fb2133621ca836 (patch) | |
tree | 7a9702d24d8648deed352c8786a94799e7f3b1fe /Modules/stropmodule.c | |
parent | 9c012af3c368e0017b3671d241f6c3e370328232 (diff) | |
download | cpython-da45d55a6ecff00ca714cbcf66fb2133621ca836.zip cpython-da45d55a6ecff00ca714cbcf66fb2133621ca836.tar.gz cpython-da45d55a6ecff00ca714cbcf66fb2133621ca836.tar.bz2 |
The strop module and test_strop.py believe replace() with a 0 count
means "replace everything". But the string module, string.replace()
amd test_string.py believe a 0 count means "replace nothing".
"Nothing" wins, strop loses.
Bugfix candidate.
Diffstat (limited to 'Modules/stropmodule.c')
-rw-r--r-- | Modules/stropmodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/stropmodule.c b/Modules/stropmodule.c index c245794..aa9cdc7 100644 --- a/Modules/stropmodule.c +++ b/Modules/stropmodule.c @@ -1121,7 +1121,7 @@ strop_replace(PyObject *self, PyObject *args) { char *str, *pat,*sub,*new_s; int len,pat_len,sub_len,out_len; - int count = 0; + int count = -1; PyObject *new; if (!PyArg_ParseTuple(args, "t#t#t#|i:replace", |