Commit 9ab3ce4d authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Fix bug #16252 with 'mailto:' documents passed to w32-shell-execute.

 src/w32fns.c (Fw32_shell_execute): Make DOCUMENT absolute only if it
 is a file name.
parent fec0e828
2013-12-25 Eli Zaretskii <>
* w32fns.c (Fw32_shell_execute): Make DOCUMENT absolute only if it
is a file name. (Bug#16252)
2013-12-25 Chong Yidong <>
* keyboard.c (Voverriding_terminal_local_map):
......@@ -6851,7 +6851,8 @@ handler application, but typically it is one of the following common
DOCUMENT is typically the name of a document file or a URL, but can
also be a program executable to run, or a directory to open in the
Windows Explorer.
Windows Explorer. If it is a file, it must be a local one; this
function does not support remote file names.
If DOCUMENT is a program executable, the optional third arg PARAMETERS
can be a string containing command line parameters that will be passed
......@@ -6875,6 +6876,7 @@ an integer representing a ShowWindow flag:
#ifndef CYGWIN
int use_unicode = w32_unicode_filenames;
char *doc_a = NULL, *params_a = NULL, *ops_a = NULL;
Lisp_Object absdoc;
CHECK_STRING (document);
......@@ -6903,7 +6905,16 @@ an integer representing a ShowWindow flag:
? XINT (show_flag) : SW_SHOWDEFAULT));
#else /* !CYGWIN */
current_dir = ENCODE_FILE (current_dir);
document = ENCODE_FILE (Fexpand_file_name (document, Qnil));
/* We have a situation here. If DOCUMENT is a relative file name,
and is not in CURRENT_DIR, ShellExecute below will fail to find
it. So we need to make the file name absolute. But DOCUMENT
does not have to be a file, it can be a URL, for example. So we
make it absolute only if it is an existing file; if it is a file
that does not exist, tough. */
absdoc = Fexpand_file_name (document, Qnil);
if (!NILP (Ffile_exists_p (absdoc)))
document = absdoc;
document = ENCODE_FILE (document);
if (use_unicode)
wchar_t document_w[MAX_PATH], current_dir_w[MAX_PATH];
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment