subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1476608 - /subversion/trunk/subversion/svn/util.c
Date Sat, 27 Apr 2013 16:06:34 GMT
Author: julianfoad
Date: Sat Apr 27 16:06:34 2013
New Revision: 1476608

URL: http://svn.apache.org/r1476608
Log:
* subversion/svn/util.c
  (svn_cl__get_log_message): Convert to UTF-8 before rather than after
    trying to strip the EOF marker text and the junk that follows it.  This
    will only make a difference if there are character encodings in use that
    are not compatible with ASCII; otherwise it is just for consistency of
    coding style.

Modified:
    subversion/trunk/subversion/svn/util.c

Modified: subversion/trunk/subversion/svn/util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/util.c?rev=1476608&r1=1476607&r2=1476608&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/util.c (original)
+++ subversion/trunk/subversion/svn/util.c Sat Apr 27 16:06:34 2013
@@ -343,22 +343,17 @@ svn_cl__get_log_message(const char **log
   *tmp_file = NULL;
   if (lmb->message)
     {
-      svn_stringbuf_t *log_msg_buf = svn_stringbuf_create(lmb->message, pool);
-      svn_string_t *log_msg_str = apr_pcalloc(pool, sizeof(*log_msg_str));
+      svn_string_t *log_msg_str = svn_string_create(lmb->message, pool);
 
-      /* Trim incoming messages of the EOF marker text and the junk
-         that follows it.  */
-      truncate_buffer_at_prefix(&(log_msg_buf->len), log_msg_buf->data,
-                                EDITOR_EOF_PREFIX);
-
-      /* Make a string from a stringbuf, sharing the data allocation. */
-      log_msg_str->data = log_msg_buf->data;
-      log_msg_str->len = log_msg_buf->len;
       SVN_ERR_W(svn_subst_translate_string2(&log_msg_str, FALSE, FALSE,
                                             log_msg_str, lmb->message_encoding,
                                             FALSE, pool, pool),
                 _("Error normalizing log message to internal format"));
 
+      /* Strip off the EOF marker text and the junk that follows it. */
+      truncate_buffer_at_prefix(&(log_msg_buf->len), (char *)log_msg_str->data,
+                                EDITOR_EOF_PREFIX);
+
       *log_msg = log_msg_str->data;
       return SVN_NO_ERROR;
     }
@@ -466,7 +461,7 @@ svn_cl__get_log_message(const char **log
       if (msg_string)
         message = svn_stringbuf_create_from_string(msg_string, pool);
 
-      /* Strip the prefix from the buffer. */
+      /* Strip off the EOF marker text and the junk that follows it. */
       if (message)
         truncate_buffer_at_prefix(&message->len, message->data,
                                   EDITOR_EOF_PREFIX);



Mime
View raw message