[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH][REPOST] Don't add extra blank line to log messages

From: Patrik Rådman <pradman_at_abo.fi>
Date: 2004-03-26 20:20:53 CET

Hi,

I didn't receive any comments to the first posting of this patch, so here
it is again, this time with commented code, and a better explanation: :)

If you commit with 'svn ci . -m "Oneliner comment"' you get this:

------------------------------------------------------------------------
r18 | patrik | 2004-03-26 20:52:58 +0200 (Fri, 26 Mar 2004) | 1 line

Oneliner comment
------------------------------------------------------------------------

...but if you enter the log message via $EDITOR, you get this:

------------------------------------------------------------------------
r19 | patrik | 2004-03-26 20:53:45 +0200 (Fri, 26 Mar 2004) | 2 lines

Oneliner comment

------------------------------------------------------------------------

The patch below removes the extra blank line.

Index: subversion/clients/cmdline/util.c
===================================================================
--- subversion/clients/cmdline/util.c (revision 9214)
+++ subversion/clients/cmdline/util.c (working copy)
@@ -384,6 +384,13 @@
           || (*(substring - 1) == '\n'))
         {
           *substring = '\0';
+ /* Remove the newline character(s) before PREFIX in order to
+ avoid an extra blank line after the log message. */
+ while ((*(substring - 1) == '\r') || (*(substring - 1) == '\n'))
+ {
+ substring--;
+ *substring = '\0';
+ }
           if (new_len)
             *new_len = substring - buffer;
         }

-- 
Patrik Rådman
patrik at iki dot fi
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Mar 27 19:28:57 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.