aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32fns.c
diff options
context:
space:
mode:
authorEli Zaretskii2010-05-07 20:08:31 +0300
committerEli Zaretskii2010-05-07 20:08:31 +0300
commit5cba3209efc2b024f717ba8eaeb198d2701b8088 (patch)
tree1d50775642dc861fa852bdb27589c4a8570bf685 /src/w32fns.c
parent59d93e877072c242f5947ed6f2a536a14629393b (diff)
downloademacs-5cba3209efc2b024f717ba8eaeb198d2701b8088.tar.gz
emacs-5cba3209efc2b024f717ba8eaeb198d2701b8088.zip
Fix bug #6126.
w32fns.c: Include w32.h. (Fw32_shell_execute): Decode the error message before passing it to `error'.
Diffstat (limited to 'src/w32fns.c')
-rw-r--r--src/w32fns.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index 795e7208569..bc310da0d2f 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -47,6 +47,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
47#include "systime.h" 47#include "systime.h"
48#include "termhooks.h" 48#include "termhooks.h"
49#include "w32heap.h" 49#include "w32heap.h"
50#include "w32.h"
50 51
51#include "bitmaps/gray.xbm" 52#include "bitmaps/gray.xbm"
52 53
@@ -6333,6 +6334,7 @@ an integer representing a ShowWindow flag:
6333 Lisp_Object operation, document, parameters, show_flag; 6334 Lisp_Object operation, document, parameters, show_flag;
6334{ 6335{
6335 Lisp_Object current_dir; 6336 Lisp_Object current_dir;
6337 char *errstr;
6336 6338
6337 CHECK_STRING (document); 6339 CHECK_STRING (document);
6338 6340
@@ -6353,7 +6355,17 @@ an integer representing a ShowWindow flag:
6353 XINT (show_flag) : SW_SHOWDEFAULT)) 6355 XINT (show_flag) : SW_SHOWDEFAULT))
6354 > 32) 6356 > 32)
6355 return Qt; 6357 return Qt;
6356 error ("ShellExecute failed: %s", w32_strerror (0)); 6358 errstr = w32_strerror (0);
6359 /* The error string might be encoded in the locale's encoding. */
6360 if (!NILP (Vlocale_coding_system))
6361 {
6362 Lisp_Object decoded =
6363 code_convert_string_norecord (make_unibyte_string (errstr,
6364 strlen (errstr)),
6365 Vlocale_coding_system, 0);
6366 errstr = (char *)SDATA (decoded);
6367 }
6368 error ("ShellExecute failed: %s", errstr);
6357} 6369}
6358 6370
6359/* Lookup virtual keycode from string representing the name of a 6371/* Lookup virtual keycode from string representing the name of a