summaryrefslogtreecommitdiffstats
path: root/Objects/stringobject.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-03-30 23:16:44 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-03-30 23:16:44 (GMT)
commit0e431b9311a17778dc19f292facdefcdece64553 (patch)
tree870d62dfdcf7ad19745eccbfa14d284d5baedd7d /Objects/stringobject.c
parenta4598a30087fe09ea2c7ad42cabb01f33c30a125 (diff)
downloadcpython-0e431b9311a17778dc19f292facdefcdece64553.zip
cpython-0e431b9311a17778dc19f292facdefcdece64553.tar.gz
cpython-0e431b9311a17778dc19f292facdefcdece64553.tar.bz2
fix indentation and add braces
Diffstat (limited to 'Objects/stringobject.c')
-rw-r--r--Objects/stringobject.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index e1ea3cd..1fde8c7 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;
+ }
}
}