You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by sv...@apache.org on 2021/01/30 04:00:44 UTC

svn commit: r1886041 - in /subversion/branches/1.14.x: ./ STATUS subversion/libsvn_subr/cmdline.c

Author: svn-role
Date: Sat Jan 30 04:00:44 2021
New Revision: 1886041

URL: http://svn.apache.org/viewvc?rev=1886041&view=rev
Log:
Merge r1882234 from trunk:

 * r1882234
   Fix file name to edit from utf8 to local style.
   Justification:
     Editor invocation should work correctly in any valid locale.
   Votes:
     +1: futatuki, jcorvel, stsp

Modified:
    subversion/branches/1.14.x/   (props changed)
    subversion/branches/1.14.x/STATUS
    subversion/branches/1.14.x/subversion/libsvn_subr/cmdline.c

Propchange: subversion/branches/1.14.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1882234

Modified: subversion/branches/1.14.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.14.x/STATUS?rev=1886041&r1=1886040&r2=1886041&view=diff
==============================================================================
--- subversion/branches/1.14.x/STATUS (original)
+++ subversion/branches/1.14.x/STATUS Sat Jan 30 04:00:44 2021
@@ -67,13 +67,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1882234
-   Fix file name to edit from utf8 to local style.
-   Justification:
-     Editor invocation should work correctly in any valid locale.
-   Votes:
-     +1: futatuki, jcorvel, stsp
-
  * r1885953
    Fix file name encoding and quoting when invoking editor on Windows.
    Justification:

Modified: subversion/branches/1.14.x/subversion/libsvn_subr/cmdline.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.14.x/subversion/libsvn_subr/cmdline.c?rev=1886041&r1=1886040&r2=1886041&view=diff
==============================================================================
--- subversion/branches/1.14.x/subversion/libsvn_subr/cmdline.c (original)
+++ subversion/branches/1.14.x/subversion/libsvn_subr/cmdline.c Sat Jan 30 04:00:44 2021
@@ -1405,6 +1405,7 @@ svn_cmdline__edit_file_externally(const
                                   apr_pool_t *pool)
 {
   const char *editor, *cmd, *base_dir, *file_name, *base_dir_apr;
+  const char *file_name_local;
   char *old_cwd;
   int sys_err;
   apr_status_t apr_err;
@@ -1428,9 +1429,11 @@ svn_cmdline__edit_file_externally(const
     return svn_error_wrap_apr
       (apr_err, _("Can't change working directory to '%s'"), base_dir);
 
+  SVN_ERR(svn_path_cstring_from_utf8(&file_name_local,
+                                     escape_path(pool, file_name), pool));
   /* editor is explicitly documented as being interpreted by the user's shell,
      and as such should already be quoted/escaped as needed. */
-  cmd = apr_psprintf(pool, "%s %s", editor, escape_path(pool, file_name));
+  cmd = apr_psprintf(pool, "%s %s", editor, file_name_local);
   sys_err = system(cmd);
 
   apr_err = apr_filepath_set(old_cwd, pool);
@@ -1586,13 +1589,14 @@ svn_cmdline__edit_string_externally(svn_
     goto cleanup;
 
   /* Prepare the editor command line.  */
-  err = svn_utf_cstring_from_utf8(&tmpfile_native, tmpfile_name, pool);
+  err = svn_utf_cstring_from_utf8(&tmpfile_native,
+                                  escape_path(pool, tmpfile_name), pool);
   if (err)
     goto cleanup;
 
   /* editor is explicitly documented as being interpreted by the user's shell,
      and as such should already be quoted/escaped as needed. */
-  cmd = apr_psprintf(pool, "%s %s", editor, escape_path(pool, tmpfile_native));
+  cmd = apr_psprintf(pool, "%s %s", editor, tmpfile_native);
 
   /* If the caller wants us to leave the file around, return the path
      of the file we'll use, and make a note not to destroy it.  */