Fix encoding of error message on failure of system() call.
* subversion/libsvn_subr/cmdline.c
(svn_cmdline__edit_file_externally, svn_cmdline__edit_string_externally):
Transcode command line, passed to system(), to before composing
error message.
@@ -1499,10 +1499,16 @@ svn_cmdline__edit_file_externally(const char *path,
stderr, TRUE /* fatal */, "svn: ");
if (sys_err)
+ {
+ const char *cmd_utf8;
+
/* Extracting any meaning from sys_err is platform specific, so just
use the raw value. */
+ SVN_ERR(svn_utf_cstring_to_utf8(&cmd_utf8, cmd, pool));
return svn_error_createf(SVN_ERR_EXTERNAL_PROGRAM, NULL,
- _("system('%s') returned %d"), cmd, sys_err);
+ _("system('%s') returned %d"),
+ cmd_utf8, sys_err);
+ }
return SVN_NO_ERROR;
}
@@ -1678,10 +1684,14 @@ svn_cmdline__edit_string_externally(svn_string_t **edited_contents /* UTF-8! */,
#endif
if (sys_err != 0)
{
+ const char *cmd_utf8;
+
/* Extracting any meaning from sys_err is platform specific, so just
use the raw value. */
+ SVN_ERR(svn_utf_cstring_to_utf8(&cmd_utf8, cmd, pool));
err = svn_error_createf(SVN_ERR_EXTERNAL_PROGRAM, NULL,
- _("system('%s') returned %d"), cmd, sys_err);
+ _("system('%s') returned %d"),
+ cmd_utf8, sys_err);
goto cleanup;
}
