Commit cb13e9a8 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Fix bug #16558 with w32-shell-execute on remote file names.

 src/w32fns.c (Fw32_shell_execute): Don't call file-exists-p for
 DOCUMENT that is a "remote" file name, i.e. a file-handler exists
 for it.
parent 94304aea
2014-02-01 Eli Zaretskii <eliz@gnu.org>
* w32fns.c (Fw32_shell_execute): Don't call file-exists-p for
DOCUMENT that is a "remote" file name, i.e. a file-handler exists
for it. (Bug#16558)
2014-01-30 Andreas Schwab <schwab@linux-m68k.org>
* process.c (create_process): Reset SIGPROF handler in the child.
......
......@@ -6892,7 +6892,8 @@ 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;
Lisp_Object absdoc, handler;
struct gcpro gcpro1;
#endif
CHECK_STRING (document);
......@@ -6927,10 +6928,24 @@ an integer representing a ShowWindow flag:
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. */
GCPRO1 (absdoc);
absdoc = Fexpand_file_name (document, Qnil);
if (!NILP (Ffile_exists_p (absdoc)))
document = absdoc;
document = ENCODE_FILE (document);
/* Don't call file handlers for file-exists-p, since they might
attempt to access the file, which could fail or produce undesired
consequences, see bug#16558 for an example. */
handler = Ffind_file_name_handler (absdoc, Qfile_exists_p);
if (NILP (handler))
{
Lisp_Object absdoc_encoded = ENCODE_FILE (absdoc);
if (faccessat (AT_FDCWD, SSDATA (absdoc_encoded), F_OK, AT_EACCESS) == 0)
document = absdoc_encoded;
else
document = ENCODE_FILE (document);
}
else
document = ENCODE_FILE (document);
UNGCPRO;
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