]> granicus.if.org Git - python/commitdiff
add braces and fix indentation
authorBenjamin Peterson <benjamin@python.org>
Sun, 30 Mar 2014 23:23:24 +0000 (19:23 -0400)
committerBenjamin Peterson <benjamin@python.org>
Sun, 30 Mar 2014 23:23:24 +0000 (19:23 -0400)
Objects/stringobject.c

index 1fde8c71fc0ea24fa7e448ef9b804053a9e6eadc..83dab085b68d147ca03ce553fcd5fa77a23875f5 100644 (file)
@@ -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;