]> thyrsus.com Git - ctopy.git/commitdiff
Boxed comments almost right, comment start delimiter in battle.c not correct.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 28 Sep 2006 21:05:56 +0000 (21:05 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 28 Sep 2006 21:05:56 +0000 (21:05 +0000)
ctopy

diff --git a/ctopy b/ctopy
index 841decfffa14037bb1eb62c3aea37be37e9b311d..ab94e2a4850067867cf2072950d336c0d32123d4 100755 (executable)
--- a/ctopy
+++ b/ctopy
@@ -169,9 +169,10 @@ def ctopy(input, debug=0):
                 if regions[i].count("\n") <= 1:                # winged comment
                     regions[i] = "#" + regions[i][2:-2]
                 elif re.search("/\*+\n", regions[i]):  # boxed comment
-                    regions[i] = re.sub(r"\n([ \t]*) \*", r"\n\1 ", regions[i])
-                    regions[i] = re.sub(r"^([ \t]*)/\*+", r"\1", regions[i])
-                    regions[i] = re.sub(r"\n([ \t]*)\*+/$", r"\n\1", regions[i])
+                    regions[i] = re.sub(r"\n([ \t]*) \* ?", r"\n\1",regions[i])
+                    regions[i] = re.sub(r"\n([ \t]*)\*", r"\n\1", regions[i])
+                    regions[i] = re.sub(r"^([ \t]*)/\*+\n", r"\1\n", regions[i])
+                    regions[i] = re.sub(r"\n([ \t]*)\**/", r"\n\1", regions[i])
                     regions[i] = re.sub(r"\n([ \t]*)(?!#)", r"\n\1# ", regions[i])
                 else:
                     regions[i] = regions[i].replace("/*", "#")