diff options
-rw-r--r-- | Lib/test/test_strop.py | 2 | ||||
-rw-r--r-- | Modules/stropmodule.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_strop.py b/Lib/test/test_strop.py index 5770046..de7a795 100644 --- a/Lib/test/test_strop.py +++ b/Lib/test/test_strop.py @@ -77,7 +77,7 @@ test('replace', 'one!two!three!', 'one@two!three!', '!', '@', 1) test('replace', 'one!two!three!', 'one@two@three!', '!', '@', 2) test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 3) test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 4) -test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 0) +test('replace', 'one!two!three!', 'one!two!three!', '!', '@', 0) test('replace', 'one!two!three!', 'one@two@three@', '!', '@') test('replace', 'one!two!three!', 'one!two!three!', 'x', '@') test('replace', 'one!two!three!', 'one!two!three!', 'x', '@', 2) 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", |