Mercurial > emacs
comparison src/w32fns.c @ 108496:49f3d201fdd0
Backport from trunk: Fix bug #6126.
makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(SRC)/w32.h.
w32fns.c: Include w32.h.
(Fw32_shell_execute): Decode the error message before passing it
to `error'.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Tue, 11 May 2010 20:23:52 +0300 |
parents | 3153ca396956 |
children | 2f0720afc474 1b5ca039f5f2 |
comparison
equal
deleted
inserted
replaced
108495:ecbac408fa45 | 108496:49f3d201fdd0 |
---|---|
45 #include "ccl.h" | 45 #include "ccl.h" |
46 #include "fontset.h" | 46 #include "fontset.h" |
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 |
53 #include <commctrl.h> | 54 #include <commctrl.h> |
54 #include <commdlg.h> | 55 #include <commdlg.h> |
6331 6 - start minimized */) | 6332 6 - start minimized */) |
6332 (operation, document, parameters, show_flag) | 6333 (operation, document, parameters, show_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 |
6339 /* Encode filename, current directory and parameters. */ | 6341 /* Encode filename, current directory and parameters. */ |
6340 current_dir = ENCODE_FILE (current_buffer->directory); | 6342 current_dir = ENCODE_FILE (current_buffer->directory); |
6351 SDATA (current_dir), | 6353 SDATA (current_dir), |
6352 (INTEGERP (show_flag) ? | 6354 (INTEGERP (show_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 |
6360 non-ascii keystroke into the corresponding virtual key, using | 6372 non-ascii keystroke into the corresponding virtual key, using |
6361 lispy_function_keys. */ | 6373 lispy_function_keys. */ |