From 9e48fa42bfc24291f84c50545488893df964b0d8 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sat, 10 Sep 2011 13:50:25 +0200 Subject: [PATCH] Fix AppendComment The joining of two comments was not performed correctly if the second one had the braces yet to be added: the closing brace was not added in that case. --- backend.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/backend.c b/backend.c index ae1eba1..7a892e5 100644 --- a/backend.c +++ b/backend.c @@ -14623,6 +14623,7 @@ if(appData.debugMode) fprintf(debugFP, "Append: in='%s' %d\n", text, addBraces); if (len == 0) return; if (commentList[index] != NULL) { + Boolean addClosingBrace = addBraces; old = commentList[index]; oldlen = strlen(old); while(commentList[index][oldlen-1] == '\n') @@ -14639,7 +14640,7 @@ if(appData.debugMode) fprintf(debugFP, "Append: in='%s' %d\n", text, addBraces); if(addBraces) strcat(commentList[index], addBraces == 2 ? "\n(" : "\n{\n"); else strcat(commentList[index], "\n"); strcat(commentList[index], text); - if(addBraces) strcat(commentList[index], addBraces == 2 ? ")\n" : "\n}\n"); + if(addClosingBrace) strcat(commentList[index], addClosingBrace == 2 ? ")\n" : "\n}\n"); else strcat(commentList[index], "\n"); } else { commentList[index] = (char *) malloc(len + 6); // perhaps wastes 4... -- 1.7.0.4