Minor fixes in w32-shell-execute.

src/w32fns.c (Fw32_shell_execute): Ensure DOCUMENT is an absolute
 file name when it is submitted to ShellExecute.  Simplify code.
 Don't test DOCUMENT for being a string, as that is enforced by
 CHECK_STRING.  Doc fix.
This commit is contained in:
Eli Zaretskii 2013-12-24 19:21:06 +02:00
parent 18cee9eca2
commit ec6e26b811
2 changed files with 18 additions and 21 deletions

View file

@ -1,3 +1,10 @@
2013-12-24 Eli Zaretskii <eliz@gnu.org>
* w32fns.c (Fw32_shell_execute): Ensure DOCUMENT is an absolute
file name when it is submitted to ShellExecute. Simplify code.
Don't test DOCUMENT for being a string, as that is enforced by
CHECK_STRING. Doc fix.
2013-12-23 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (tool_bar_height): Use WINDOW_PIXEL_WIDTH to set up the

View file

@ -6844,6 +6844,8 @@ handler application, but typically it is one of the following common
specified DOCUMENT
\"find\" - initiate search starting from DOCUMENT which must specify
a directory
\"runas\" - run DOCUMENT, which must be an excutable file, with
elevated privileges (a.k.a. \"as Administrator\").
nil - invoke the default OPERATION, or \"open\" if default is
not defined or unavailable
@ -6879,16 +6881,12 @@ an integer representing a ShowWindow flag:
#ifdef CYGWIN
current_dir = Fcygwin_convert_file_name_to_windows (current_dir, Qt);
if (STRINGP (document))
document = Fcygwin_convert_file_name_to_windows (document, Qt);
document = Fcygwin_convert_file_name_to_windows (document, Qt);
/* Encode filename, current directory and parameters. */
current_dir = GUI_ENCODE_FILE (current_dir);
if (STRINGP (document))
{
document = GUI_ENCODE_FILE (document);
doc_w = GUI_SDATA (document);
}
document = GUI_ENCODE_FILE (document);
doc_w = GUI_SDATA (document);
if (STRINGP (parameters))
{
parameters = GUI_ENCODE_SYSTEM (parameters);
@ -6904,20 +6902,17 @@ an integer representing a ShowWindow flag:
(INTEGERP (show_flag)
? XINT (show_flag) : SW_SHOWDEFAULT));
#else /* !CYGWIN */
current_dir = ENCODE_FILE (current_dir);
document = ENCODE_FILE (Fexpand_file_name (document, Qnil));
if (use_unicode)
{
wchar_t document_w[MAX_PATH], current_dir_w[MAX_PATH];
/* Encode filename, current directory and parameters, and
convert operation to UTF-16. */
current_dir = ENCODE_FILE (current_dir);
filename_to_utf16 (SSDATA (current_dir), current_dir_w);
if (STRINGP (document))
{
document = ENCODE_FILE (document);
filename_to_utf16 (SSDATA (document), document_w);
doc_w = document_w;
}
filename_to_utf16 (SSDATA (document), document_w);
doc_w = document_w;
if (STRINGP (parameters))
{
int len;
@ -6954,14 +6949,9 @@ an integer representing a ShowWindow flag:
{
char document_a[MAX_PATH], current_dir_a[MAX_PATH];
current_dir = ENCODE_FILE (current_dir);
filename_to_ansi (SSDATA (current_dir), current_dir_a);
if (STRINGP (document))
{
ENCODE_FILE (document);
filename_to_ansi (SSDATA (document), document_a);
doc_a = document_a;
}
filename_to_ansi (SSDATA (document), document_a);
doc_a = document_a;
if (STRINGP (parameters))
{
parameters = ENCODE_SYSTEM (parameters);