From 8312eccd3420b299e07efb2d78d8b7446e46c26a Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sun, 30 Mar 2014 19:23:24 -0400 Subject: [PATCH] add braces and fix indentation --- Objects/stringobject.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/Objects/stringobject.c b/Objects/stringobject.c index 1fde8c71fc0..83dab085b68 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;