Commit 7a7a63b4 authored by Thomas Wouters's avatar Thomas Wouters

Make s.replace() work with explicit counts exceeding 2Gb.

parent 2768b85b
...@@ -2524,11 +2524,11 @@ string_replace(PyStringObject *self, PyObject *args) ...@@ -2524,11 +2524,11 @@ string_replace(PyStringObject *self, PyObject *args)
char *new_s; char *new_s;
const Py_ssize_t len = PyString_GET_SIZE(self); const Py_ssize_t len = PyString_GET_SIZE(self);
Py_ssize_t sub_len, repl_len, out_len; Py_ssize_t sub_len, repl_len, out_len;
int count = -1; Py_ssize_t count = -1;
PyObject *newobj; PyObject *newobj;
PyObject *subobj, *replobj; PyObject *subobj, *replobj;
if (!PyArg_ParseTuple(args, "OO|i:replace", if (!PyArg_ParseTuple(args, "OO|n:replace",
&subobj, &replobj, &count)) &subobj, &replobj, &count))
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment