emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r99805: Backport from trunk: Fix b


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r99805: Backport from trunk: Fix bug #6126.
Date: Tue, 11 May 2010 20:23:52 +0300
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 99805
committer: Eli Zaretskii <address@hidden>
branch nick: emacs-23
timestamp: Tue 2010-05-11 20:23:52 +0300
message:
  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'.
modified:
  src/ChangeLog
  src/makefile.w32-in
  src/w32fns.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-05-11 15:48:29 +0000
+++ b/src/ChangeLog     2010-05-11 17:23:52 +0000
@@ -1,3 +1,11 @@
+2010-05-11  Eli Zaretskii  <address@hidden>
+
+       * 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'.  (Bug#6126)
+
 2010-05-11  Karel Klic  <address@hidden>
 
        * ftfont.c: Fix incorrect parentheses of #if condition for

=== modified file 'src/makefile.w32-in'
--- a/src/makefile.w32-in       2010-01-13 08:35:10 +0000
+++ b/src/makefile.w32-in       2010-05-11 17:23:52 +0000
@@ -1564,6 +1564,7 @@
        $(SRC)/keyboard.h \
        $(SRC)/systime.h \
        $(SRC)/termhooks.h \
+       $(SRC)/w32.h \
        $(SRC)/w32font.h \
        $(SRC)/w32gui.h \
        $(SRC)/w32heap.h \

=== modified file 'src/w32fns.c'
--- a/src/w32fns.c      2010-03-31 09:08:40 +0000
+++ b/src/w32fns.c      2010-05-11 17:23:52 +0000
@@ -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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]