subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1503009 - /subversion/trunk/subversion/libsvn_subr/subst.c
Date Sun, 14 Jul 2013 18:07:54 GMT
Author: danielsh
Date: Sun Jul 14 18:07:54 2013
New Revision: 1503009

URL: http://svn.apache.org/r1503009
Log:
Short-circuit the UTF-8 conversion when the source encoding is UTF-8.  

Do this by recognizing "UTF-8" as a magic number; that magic number (well,
magic string) is already used once in svnsync's normalize_string().  The
reason for the short-circuit is that the conversion would be a no-op; see
<http://mid.gmane.org/20130714165516.GA71250@minotaur.apache.org>.

This fixes svnsync_authz_tests.py 5 when apr_xlate_open() returns something
other than APR_SUCCESS in utf.c:xlate_alloc_handle().

* subversion/libsvn_subr/subst.c
  (svn_subst_translate_string2): As above.

Modified:
    subversion/trunk/subversion/libsvn_subr/subst.c

Modified: subversion/trunk/subversion/libsvn_subr/subst.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/subst.c?rev=1503009&r1=1503008&r2=1503009&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/subst.c (original)
+++ subversion/trunk/subversion/libsvn_subr/subst.c Sun Jul 14 18:07:54 2013
@@ -1960,7 +1960,11 @@ svn_subst_translate_string2(svn_string_t
       return SVN_NO_ERROR;
     }
 
-  if (encoding)
+  if (encoding && !strcmp(encoding, "UTF-8")) 
+    {
+      val_utf8 = value->data;
+    }
+  else if (encoding)
     {
       SVN_ERR(svn_utf_cstring_to_utf8_ex2(&val_utf8, value->data,
                                           encoding, scratch_pool));



Mime
View raw message