From: Benjamin Peterson Date: Sun, 30 Mar 2014 23:23:24 +0000 (-0400) Subject: add braces and fix indentation X-Git-Tag: v2.7.7rc1~100 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8312eccd3420b299e07efb2d78d8b7446e46c26a;p=python add braces and fix indentation --- diff --git a/Objects/stringobject.c b/Objects/stringobject.c index 1fde8c71fc..83dab085b6 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -3125,25 +3125,26 @@ string_expandtabs(PyStringObject *self, PyObject *args) q = PyString_AS_STRING(u); /* next output char */ qe = PyString_AS_STRING(u) + PyString_GET_SIZE(u); /* end of output */ - for (p = PyString_AS_STRING(self); p < e; p++) - if (*p == '\t') { - if (tabsize > 0) { - i = tabsize - (j % tabsize); - j += i; - while (i--) { - if (q >= qe) - goto overflow2; - *q++ = ' '; + for (p = PyString_AS_STRING(self); p < e; p++) { + if (*p == '\t') { + if (tabsize > 0) { + i = tabsize - (j % tabsize); + j += i; + while (i--) { + if (q >= qe) + goto overflow2; + *q++ = ' '; + } } } - } - else { - if (q >= qe) - goto overflow2; - *q++ = *p; - j++; - if (*p == '\n' || *p == '\r') - j = 0; + else { + if (q >= qe) + goto overflow2; + *q++ = *p; + j++; + if (*p == '\n' || *p == '\r') + j = 0; + } } return u;