Commit 5cba3209 authored by Eli Zaretskii's avatar Eli Zaretskii

Fix bug #6126.

 w32fns.c: Include w32.h.
 (Fw32_shell_execute): Decode the error message before passing it
 to `error'.
parent 59d93e87
2010-05-07 Eli Zaretskii <eliz@gnu.org> 2010-05-07 Eli Zaretskii <eliz@gnu.org>
* w32fns.c: Include w32.h.
(Fw32_shell_execute): Decode the error message before passing it
to `error'. (Bug#6126)
* msdos.c (dos_set_window_size): * msdos.c (dos_set_window_size):
* w16select.c (Fx_selection_exists_p): Use `Fsymbol_value (foo)' * w16select.c (Fx_selection_exists_p): Use `Fsymbol_value (foo)'
instead of `XSYMBOL (foo)->value'. instead of `XSYMBOL (foo)->value'.
......
...@@ -47,6 +47,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ ...@@ -47,6 +47,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "systime.h" #include "systime.h"
#include "termhooks.h" #include "termhooks.h"
#include "w32heap.h" #include "w32heap.h"
#include "w32.h"
#include "bitmaps/gray.xbm" #include "bitmaps/gray.xbm"
...@@ -6333,6 +6334,7 @@ an integer representing a ShowWindow flag: ...@@ -6333,6 +6334,7 @@ an integer representing a ShowWindow flag:
Lisp_Object operation, document, parameters, show_flag; Lisp_Object operation, document, parameters, show_flag;
{ {
Lisp_Object current_dir; Lisp_Object current_dir;
char *errstr;
CHECK_STRING (document); CHECK_STRING (document);
...@@ -6353,7 +6355,17 @@ an integer representing a ShowWindow flag: ...@@ -6353,7 +6355,17 @@ an integer representing a ShowWindow flag:
XINT (show_flag) : SW_SHOWDEFAULT)) XINT (show_flag) : SW_SHOWDEFAULT))
> 32) > 32)
return Qt; return Qt;
error ("ShellExecute failed: %s", w32_strerror (0)); errstr = w32_strerror (0);
/* The error string might be encoded in the locale's encoding. */
if (!NILP (Vlocale_coding_system))
{
Lisp_Object decoded =
code_convert_string_norecord (make_unibyte_string (errstr,
strlen (errstr)),
Vlocale_coding_system, 0);
errstr = (char *)SDATA (decoded);
}
error ("ShellExecute failed: %s", errstr);
} }
/* Lookup virtual keycode from string representing the name of a /* Lookup virtual keycode from string representing the name of a
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment