From ru@whale.sunbay.crimea.ua  Fri Nov  8 03:07:36 2002
Return-Path: <ru@whale.sunbay.crimea.ua>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 1635A37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  8 Nov 2002 03:07:36 -0800 (PST)
Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 68F0643E6E
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  8 Nov 2002 03:07:32 -0800 (PST)
	(envelope-from ru@whale.sunbay.crimea.ua)
Received: from whale.sunbay.crimea.ua (ru@localhost [127.0.0.1])
	by whale.sunbay.crimea.ua (8.12.6/8.12.6/Sunbay) with ESMTP id gA8B7RMZ057507
	(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 8 Nov 2002 13:07:27 +0200 (EET)
	(envelope-from ru@whale.sunbay.crimea.ua)
Received: (from ru@localhost)
	by whale.sunbay.crimea.ua (8.12.6/8.12.6/Submit) id gA8B7OvB057506;
	Fri, 8 Nov 2002 13:07:24 +0200 (EET)
Message-Id: <200211081107.gA8B7OvB057506@whale.sunbay.crimea.ua>
Date: Fri, 8 Nov 2002 13:07:24 +0200 (EET)
From: Ruslan Ermilov <ru@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] CVS 1.11.2 cannot reuse log messages
X-Send-Pr-Version: 3.113
X-GNATS-Notify: ru

>Number:         45137
>Category:       gnu
>Synopsis:       [PATCH] CVS 1.11.2 cannot reuse log messages
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    peter
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 08 03:10:02 PST 2002
>Closed-Date:    Sat May 12 10:04:56 GMT 2007
>Last-Modified:  Sat May 12 10:04:56 GMT 2007
>Originator:     Ruslan Ermilov
>Release:        FreeBSD 4.7-STABLE i386
>Organization:
Sunbay Software Ltd
>Environment:
System: FreeBSD whale.sunbay.crimea.ua 4.7-STABLE FreeBSD 4.7-STABLE #0: Sat Nov 2 10:42:34 EET 2002 ru@whale.sunbay.crimea.ua:/usr/obj/usr/src/sys/WHALE i386

>Description:
CVS 1.11.2 has a bug which prevents it from reusing the log messages
when operating in local mode.  (Not applicable to "pserver" mode.)

>How-To-Repeat:
Add or modify files in two different checked-out directories.
Run ``cvs commit''.
Enter the log messages.
When prompted to enter the log for the second file, leave it unchanged.
When prompted what to do, choose ``continue''.
Watch the second file gets an empty (null) log.

>Fix:
Fixed in CVS repo on cvs.cvshome.org.  ("emply" below should be
spelled "empty".)

Index: logmsg.c
===================================================================
RCS file: /cvs/ccvs/src/logmsg.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -p -u -r1.61 -r1.62
--- logmsg.c	7 May 2002 20:48:21 -0000	1.61
+++ logmsg.c	29 Aug 2002 05:00:59 -0000	1.62
@@ -354,16 +354,16 @@ do_editor (dir, messagep, repository, ch
     if (fclose (fp) < 0)
 	error (0, errno, "warning: cannot close %s", fname);
 
-    if (pre_stbuf.st_mtime == post_stbuf.st_mtime ||
-	*messagep == NULL ||
-	(*messagep)[0] == '\0' ||
-	strcmp (*messagep, "\n") == 0)
+    /* canonicalize emply messages */
+    if (*messagep != NULL &&
+        (**messagep == '\0' || strcmp (*messagep, "\n") == 0))
+    {
+	free (*messagep);
+	*messagep = NULL;
+    }
+
+    if (pre_stbuf.st_mtime == post_stbuf.st_mtime || *messagep == NULL)
     {
-	if (*messagep)
-	{
-	    free (*messagep);
-	    *messagep = NULL;
-	}
 	for (;;)
 	{
 	    (void) printf ("\nLog message unchanged or not specified\n");
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->peter 
Responsible-Changed-By: ru 
Responsible-Changed-When: Fri Nov 8 04:13:47 PST 2002 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=45137 
State-Changed-From-To: open->closed 
State-Changed-By: pav 
State-Changed-When: Sat May 12 10:03:36 UTC 2007 
State-Changed-Why:  
My 6-STABLE system already have this code 

http://www.freebsd.org/cgi/query-pr.cgi?pr=45137 
>Unformatted:
