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

[PATCH] truncate EDITOR_EOF_PREFIX with previous EOL

From: Olleg Samoylov <olleg_at_mipt.ru>
Date: 2005-07-19 13:18:15 CEST

In log message wroten by editor always added trailing eol. This patch remove it.

-- 
Olleg Samoylov
[[[
* subversion/clients/cmdline/util.c
  (truncate_buffer_at_prefix): Remove trailing eol from log message.
]]]
Index: subversion/clients/cmdline/util.c
===================================================================
--- subversion/clients/cmdline/util.c   (revision 15361)
+++ subversion/clients/cmdline/util.c   (working copy)
@@ -417,6 +417,14 @@
           || (*(substring - 1) == '\r')
           || (*(substring - 1) == '\n'))
         {
+         /* Remove previous eol. */
+         while (substring != buffer)
+           if ((*(substring - 1) == '\r')
+               || (*(substring - 1) == '\n'))
+             substring--;
+           else 
+             break;
+
           *substring = '\0';
           if (new_len)
             *new_len = substring - buffer;

Received on Tue Jul 19 13:18:55 2005

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.