Kaydet (Commit) 93be92d3 authored tarafından Barry Warsaw's avatar Barry Warsaw

split_whitespace(): Make sure delimiter is stripped from the beginning

of the remainder item (last item in list) when maxsplit is < the
number of occurrences.
üst 8529ebb7
......@@ -85,7 +85,10 @@ split_whitespace(s, len, maxsplit)
goto finally;
countsplit++;
if (maxsplit && (countsplit >= maxsplit)) {
while (i < len && isspace(Py_CHARMASK(s[i]))) {
i = i+1;
}
if (maxsplit && (countsplit >= maxsplit) && i < len) {
item = PyString_FromStringAndSize(
s+i, (int)(len - i));
if (item == 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