[tin-dev] Double blank line with sigdashes=OFF

Dennis Preiser dennis at d--p.de
Mon Jul 26 17:47:19 CEST 2021


Hi,

currently the signature is appended with the following code:

fprintf(fp, "\n%s", thisgroup->attribute->sigdashes ? SIGDASHES : "\n");

With sigdashes=OFF this results in two consecutive blank lines before
the signature. Is there a reason for the second blank line? If not, we
could do without the second empty line.

Dennis

diff -urp tin-2.6.0_r2/src/sigfile.c tin-2.6.0_r3/src/sigfile.c
--- tin-2.6.0_r2/src/sigfile.c	2021-03-05 00:27:31.000000000 +0100
+++ tin-2.6.0_r3/src/sigfile.c	2021-07-26 17:38:34.000000000 +0200
@@ -83,7 +83,7 @@ msg_write_signature(
 			char *sigcmd, *sigattr, *ptr;
 			char cmd[PATH_LEN];
 
-			fprintf(fp, "\n%s", thisgroup->attribute->sigdashes ? SIGDASHES : "\n");
+			fprintf(fp, "\n%s", thisgroup->attribute->sigdashes ? SIGDASHES : "");
 			sigattr = thisgroup->attribute->sigfile + 1;
 
 			if ((ptr = strstr(sigattr, "%G"))) {
@@ -145,7 +145,7 @@ msg_write_signature(
 			if (debug & DEBUG_MISC)
 				error_message(2, "USING random sig=[%s]", sigfile);
 #endif /* DEBUG */
-			fprintf(fp, "\n%s", thisgroup->attribute->sigdashes ? SIGDASHES : "\n");
+			fprintf(fp, "\n%s", thisgroup->attribute->sigdashes ? SIGDASHES : "");
 			joinpath(pathfixed, sizeof(pathfixed), path, ".sigfixed");
 #ifdef DEBUG
 			if (debug & DEBUG_MISC)
@@ -178,7 +178,7 @@ msg_write_signature(
 		}
 
 		if ((sigfp = fopen(path, "r")) != NULL) {
-			fprintf(fp, "\n%s", thisgroup->attribute->sigdashes ? SIGDASHES : "\n");
+			fprintf(fp, "\n%s", thisgroup->attribute->sigdashes ? SIGDASHES : "");
 			copy_fp(sigfp, fp);
 			fclose(sigfp);
 			return;
@@ -190,7 +190,7 @@ msg_write_signature(
 		 */
 		if ((sigfp = fopen(default_signature, "r")) != NULL) {
 			if (include_dot_signature) {
-				fprintf(fp, "\n%s", thisgroup->attribute->sigdashes ? SIGDASHES : "\n");
+				fprintf(fp, "\n%s", thisgroup->attribute->sigdashes ? SIGDASHES : "");
 				copy_fp(sigfp, fp);
 			}
 			fclose(sigfp);



More information about the tin-dev mailing list