Mercurial > emacs
diff src/w32fns.c @ 108551:d4c436ea51f4
merge trunk
author | Kenichi Handa <handa@etlken> |
---|---|
date | Mon, 10 May 2010 12:37:03 +0900 |
parents | 36d25edeedb5 |
children | 2f0720afc474 1b5ca039f5f2 |
line wrap: on
line diff
--- a/src/w32fns.c Thu May 06 09:50:39 2010 +0900 +++ b/src/w32fns.c Mon May 10 12:37:03 2010 +0900 @@ -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