# HG changeset patch # User Eli Zaretskii # Date 1273252111 -10800 # Node ID 36d25edeedb5d9e92dc19f89c48a871f5f6b29d0 # Parent 68fc9037b5026c9274c552ea5399ea9f885cb6da Fix bug #6126. w32fns.c: Include w32.h. (Fw32_shell_execute): Decode the error message before passing it to `error'. diff -r 68fc9037b502 -r 36d25edeedb5 src/ChangeLog --- a/src/ChangeLog Fri May 07 17:07:51 2010 +0300 +++ b/src/ChangeLog Fri May 07 20:08:31 2010 +0300 @@ -1,5 +1,9 @@ 2010-05-07 Eli Zaretskii + * 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): * w16select.c (Fx_selection_exists_p): Use `Fsymbol_value (foo)' instead of `XSYMBOL (foo)->value'. diff -r 68fc9037b502 -r 36d25edeedb5 src/w32fns.c --- a/src/w32fns.c Fri May 07 17:07:51 2010 +0300 +++ b/src/w32fns.c Fri May 07 20:08:31 2010 +0300 @@ -47,6 +47,7 @@ #include "systime.h" #include "termhooks.h" #include "w32heap.h" +#include "w32.h" #include "bitmaps/gray.xbm" @@ -6333,6 +6334,7 @@ Lisp_Object operation, document, parameters, show_flag; { Lisp_Object current_dir; + char *errstr; CHECK_STRING (document); @@ -6353,7 +6355,17 @@ XINT (show_flag) : SW_SHOWDEFAULT)) > 32) 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