From f0110698a71bf4774568c2fac92841c40cb5bfcf Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 28 Sep 2006 20:31:55 +0000 Subject: [PATCH] Also handles boxed comment in ai.c, but with simpler rules. --- ctopy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ctopy b/ctopy index 305beb4..841decf 100755 --- a/ctopy +++ b/ctopy @@ -169,9 +169,9 @@ 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"^([ \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]) else: regions[i] = regions[i].replace("/*", "#") -- 2.43.0