? o
Index: import.c
===================================================================
RCS file: /cvsroot/src/external/gpl2/xcvs/dist/src/import.c,v
retrieving revision 1.6
diff -u -p -u -r1.6 import.c
--- import.c	17 May 2016 14:00:09 -0000	1.6
+++ import.c	30 May 2016 17:39:59 -0000
@@ -1409,7 +1409,7 @@ add_rcs_file (const char *message, const
 	    /* We are going to put the log message in the revision on the
 	       branch.  So putting it here too seems kind of redundant, I
 	       guess (and that is what CVS has always done, anyway).  */
-	    if (fprintf (fprcs, "Initial revision") < 0)
+	    if (fprintf (fprcs, "Initial revision\n") < 0)
 		goto write_error;
 	}
 	else
@@ -1417,7 +1417,7 @@ add_rcs_file (const char *message, const
 	    if (expand_at_signs (message, (off_t) strlen (message), fprcs) < 0)
 		goto write_error;
 	}
-	if (fprintf (fprcs, "\012@\012") < 0 ||
+	if (fprintf (fprcs, "@\012") < 0 ||
 	    fprintf (fprcs, "text\012@") < 0)
 	{
 	    goto write_error;
@@ -1443,7 +1443,7 @@ add_rcs_file (const char *message, const
 		fprintf (fprcs, "log\012@") < 0 ||
 		expand_at_signs (message,
 				 (off_t) strlen (message), fprcs) < 0 ||
-		fprintf (fprcs, "\012@\012text\012") < 0 ||
+		fprintf (fprcs, "@\012text\012") < 0 ||
 		fprintf (fprcs, "@@\012") < 0)
 		goto write_error;
 	}
Index: subr.c
===================================================================
RCS file: /cvsroot/src/external/gpl2/xcvs/dist/src/subr.c,v
retrieving revision 1.3
diff -u -p -u -r1.3 subr.c
--- subr.c	17 May 2016 14:00:09 -0000	1.3
+++ subr.c	30 May 2016 17:40:00 -0000
@@ -542,7 +542,8 @@ make_message_rcsvalid (const char *messa
     if (message == NULL) message = "";
 
     /* Strip whitespace from end of lines and end of string. */
-    dp = dst = (char *) xmalloc (strlen (message) + 1);
+    /* One for NUL, one for \n */
+    dp = dst = xmalloc (strlen (message) + 2);
     for (mp = message; *mp != '\0'; ++mp)
     {
 	if (*mp == '\n')
@@ -564,7 +565,12 @@ make_message_rcsvalid (const char *messa
     if (*dst == '\0')
     {
 	free (dst);
-	dst = xstrdup ("*** empty log message ***");
+	dst = xstrdup ("*** empty log message ***\n");
+    }
+    else if (dp > dst && dp[-1] != '\n')
+    {
+	*dp++ = '\n';
+	*dp++ = '\0';
     }
 
     return dst;