diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-03-30 23:23:24 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-03-30 23:23:24 (GMT) |
commit | 8312eccd3420b299e07efb2d78d8b7446e46c26a (patch) | |
tree | cda23f7061e50ea5101c16fb73b40579d97db224 /Objects/stringobject.c | |
parent | 0e431b9311a17778dc19f292facdefcdece64553 (diff) | |
download | cpython-8312eccd3420b299e07efb2d78d8b7446e46c26a.zip cpython-8312eccd3420b299e07efb2d78d8b7446e46c26a.tar.gz cpython-8312eccd3420b299e07efb2d78d8b7446e46c26a.tar.bz2 |
add braces and fix indentation
Diffstat (limited to 'Objects/stringobject.c')
-rw-r--r-- | Objects/stringobject.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c index 1fde8c7..83dab08 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; |