subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject svn commit: r1147882 - /subversion/trunk/subversion/libsvn_repos/hooks.c
Date Mon, 18 Jul 2011 13:58:32 GMT
Author: ivan
Date: Mon Jul 18 13:58:31 2011
New Revision: 1147882

URL: http://svn.apache.org/viewvc?rev=1147882&view=rev
Log:
Convert lock token returned from pre-lock hook from native encoding to UTF-8.

* subversion/libsvn_repos/hooks.c
  (svn_repos__hooks_pre_lock): Convert hook output from native encoding to 
   UTF-8.

Modified:
    subversion/trunk/subversion/libsvn_repos/hooks.c

Modified: subversion/trunk/subversion/libsvn_repos/hooks.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/hooks.c?rev=1147882&r1=1147881&r2=1147882&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/hooks.c (original)
+++ subversion/trunk/subversion/libsvn_repos/hooks.c Mon Jul 18 13:58:31 2011
@@ -616,8 +616,20 @@ svn_repos__hooks_pre_lock(svn_repos_t *r
 
       SVN_ERR(run_hook_cmd(&buf, SVN_REPOS__HOOK_PRE_LOCK, hook, args, NULL,
                            pool));
+
       if (token)
-        *token = buf->data;
+        {
+          svn_error_t *err;
+          /* Convert hook output from native encoding to UTF-8. */
+          err = svn_utf_cstring_to_utf8(token, buf->data, pool);
+          if (err)
+            {
+              return svn_error_create(SVN_ERR_REPOS_HOOK_FAILURE, err,
+                                      _("Output of pre-lock hook could not be "
+                                        "translated from the native locale to "
+                                        "UTF-8."));
+            }
+        }
     }
   else if (token)
     *token = "";



Mime
View raw message