]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix bug in formatting of new questions
authorGuido van Rossum <guido@python.org>
Thu, 29 Sep 1994 15:19:10 +0000 (15:19 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 29 Sep 1994 15:19:10 +0000 (15:19 +0000)
Misc/renumber.py

index a62257cbc013956111e23d5acf380fb5778f9ff1..f2299b66f26a0f9535a387a18ac6602210a1a4a8 100755 (executable)
@@ -43,10 +43,12 @@ def main():
                        if n < 0: n = newquestionprog.match(line) - 3
                        if n >= 0:
                                question = question + 1
-                               line = '%d.%d. '%(chapter, question) + line[n:]
+                               number = '%d.%d. '%(chapter, question)
+                               line = number + line[n:]
                                lines[i] = line
                                questions.append('  ' + line)
                                # Add up to 4 continuations of the question
+                               n = len(number)
                                for j in range(i+1, i+5):
                                        if blankprog.match(lines[j]) >= 0:
                                                break