From: Benjamin Peterson Date: Sun, 30 Mar 2014 23:16:44 +0000 (-0400) Subject: fix indentation and add braces X-Git-Tag: v2.7.7rc1~101 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0e431b9311a17778dc19f292facdefcdece64553;p=python fix indentation and add braces --- diff --git a/Objects/stringobject.c b/Objects/stringobject.c index e1ea3cd80f..1fde8c71fc 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -3091,24 +3091,25 @@ string_expandtabs(PyStringObject *self, PyObject *args) i = 0; /* chars up to and including most recent \n or \r */ j = 0; /* chars since most recent \n or \r (use in tab calculations) */ e = PyString_AS_STRING(self) + PyString_GET_SIZE(self); /* end of input */ - for (p = PyString_AS_STRING(self); p < e; p++) - if (*p == '\t') { - if (tabsize > 0) { - incr = tabsize - (j % tabsize); - if (j > PY_SSIZE_T_MAX - incr) - goto overflow1; - j += incr; + for (p = PyString_AS_STRING(self); p < e; p++) { + if (*p == '\t') { + if (tabsize > 0) { + incr = tabsize - (j % tabsize); + if (j > PY_SSIZE_T_MAX - incr) + goto overflow1; + j += incr; + } } - } - else { - if (j > PY_SSIZE_T_MAX - 1) - goto overflow1; - j++; - if (*p == '\n' || *p == '\r') { - if (i > PY_SSIZE_T_MAX - j) + else { + if (j > PY_SSIZE_T_MAX - 1) goto overflow1; - i += j; - j = 0; + j++; + if (*p == '\n' || *p == '\r') { + if (i > PY_SSIZE_T_MAX - j) + goto overflow1; + i += j; + j = 0; + } } }