Commit 8312eccd authored by Benjamin Peterson's avatar Benjamin Peterson

add braces and fix indentation

parent 0e431b93
...@@ -3125,25 +3125,26 @@ string_expandtabs(PyStringObject *self, PyObject *args) ...@@ -3125,25 +3125,26 @@ string_expandtabs(PyStringObject *self, PyObject *args)
q = PyString_AS_STRING(u); /* next output char */ q = PyString_AS_STRING(u); /* next output char */
qe = PyString_AS_STRING(u) + PyString_GET_SIZE(u); /* end of output */ qe = PyString_AS_STRING(u) + PyString_GET_SIZE(u); /* end of output */
for (p = PyString_AS_STRING(self); p < e; p++) for (p = PyString_AS_STRING(self); p < e; p++) {
if (*p == '\t') { if (*p == '\t') {
if (tabsize > 0) { if (tabsize > 0) {
i = tabsize - (j % tabsize); i = tabsize - (j % tabsize);
j += i; j += i;
while (i--) { while (i--) {
if (q >= qe) if (q >= qe)
goto overflow2; goto overflow2;
*q++ = ' '; *q++ = ' ';
}
} }
} }
} else {
else { if (q >= qe)
if (q >= qe) goto overflow2;
goto overflow2; *q++ = *p;
*q++ = *p; j++;
j++; if (*p == '\n' || *p == '\r')
if (*p == '\n' || *p == '\r') j = 0;
j = 0; }
} }
return u; return u;
......
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