diff options
| author | Eli Zaretskii | 2013-12-24 19:21:06 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2013-12-24 19:21:06 +0200 |
| commit | ec6e26b8112dd5eea3558a5bb7e0b44f3122dea0 (patch) | |
| tree | c6d7fc6f36e295569c5f4a231d573ad8ed8ebc4a /src | |
| parent | 18cee9eca2aa558bebc4ee18cb5bc0503a85d9f2 (diff) | |
| download | emacs-ec6e26b8112dd5eea3558a5bb7e0b44f3122dea0.tar.gz emacs-ec6e26b8112dd5eea3558a5bb7e0b44f3122dea0.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/w32fns.c | 32 |
2 files changed, 18 insertions, 21 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 818ff2784be..1de6122edd0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2013-12-24 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * w32fns.c (Fw32_shell_execute): Ensure DOCUMENT is an absolute | ||
| 4 | file name when it is submitted to ShellExecute. Simplify code. | ||
| 5 | Don't test DOCUMENT for being a string, as that is enforced by | ||
| 6 | CHECK_STRING. Doc fix. | ||
| 7 | |||
| 1 | 2013-12-23 Eli Zaretskii <eliz@gnu.org> | 8 | 2013-12-23 Eli Zaretskii <eliz@gnu.org> |
| 2 | 9 | ||
| 3 | * xdisp.c (tool_bar_height): Use WINDOW_PIXEL_WIDTH to set up the | 10 | * xdisp.c (tool_bar_height): Use WINDOW_PIXEL_WIDTH to set up the |
diff --git a/src/w32fns.c b/src/w32fns.c index 59526936afe..c1621acf513 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -6844,6 +6844,8 @@ operations: | |||
| 6844 | specified DOCUMENT | 6844 | specified DOCUMENT |
| 6845 | \"find\" - initiate search starting from DOCUMENT which must specify | 6845 | \"find\" - initiate search starting from DOCUMENT which must specify |
| 6846 | a directory | 6846 | a directory |
| 6847 | \"runas\" - run DOCUMENT, which must be an excutable file, with | ||
| 6848 | elevated privileges (a.k.a. \"as Administrator\"). | ||
| 6847 | nil - invoke the default OPERATION, or \"open\" if default is | 6849 | nil - invoke the default OPERATION, or \"open\" if default is |
| 6848 | not defined or unavailable | 6850 | not defined or unavailable |
| 6849 | 6851 | ||
| @@ -6879,16 +6881,12 @@ an integer representing a ShowWindow flag: | |||
| 6879 | 6881 | ||
| 6880 | #ifdef CYGWIN | 6882 | #ifdef CYGWIN |
| 6881 | current_dir = Fcygwin_convert_file_name_to_windows (current_dir, Qt); | 6883 | current_dir = Fcygwin_convert_file_name_to_windows (current_dir, Qt); |
| 6882 | if (STRINGP (document)) | 6884 | document = Fcygwin_convert_file_name_to_windows (document, Qt); |
| 6883 | document = Fcygwin_convert_file_name_to_windows (document, Qt); | ||
| 6884 | 6885 | ||
| 6885 | /* Encode filename, current directory and parameters. */ | 6886 | /* Encode filename, current directory and parameters. */ |
| 6886 | current_dir = GUI_ENCODE_FILE (current_dir); | 6887 | current_dir = GUI_ENCODE_FILE (current_dir); |
| 6887 | if (STRINGP (document)) | 6888 | document = GUI_ENCODE_FILE (document); |
| 6888 | { | 6889 | doc_w = GUI_SDATA (document); |
| 6889 | document = GUI_ENCODE_FILE (document); | ||
| 6890 | doc_w = GUI_SDATA (document); | ||
| 6891 | } | ||
| 6892 | if (STRINGP (parameters)) | 6890 | if (STRINGP (parameters)) |
| 6893 | { | 6891 | { |
| 6894 | parameters = GUI_ENCODE_SYSTEM (parameters); | 6892 | parameters = GUI_ENCODE_SYSTEM (parameters); |
| @@ -6904,20 +6902,17 @@ an integer representing a ShowWindow flag: | |||
| 6904 | (INTEGERP (show_flag) | 6902 | (INTEGERP (show_flag) |
| 6905 | ? XINT (show_flag) : SW_SHOWDEFAULT)); | 6903 | ? XINT (show_flag) : SW_SHOWDEFAULT)); |
| 6906 | #else /* !CYGWIN */ | 6904 | #else /* !CYGWIN */ |
| 6905 | current_dir = ENCODE_FILE (current_dir); | ||
| 6906 | document = ENCODE_FILE (Fexpand_file_name (document, Qnil)); | ||
| 6907 | if (use_unicode) | 6907 | if (use_unicode) |
| 6908 | { | 6908 | { |
| 6909 | wchar_t document_w[MAX_PATH], current_dir_w[MAX_PATH]; | 6909 | wchar_t document_w[MAX_PATH], current_dir_w[MAX_PATH]; |
| 6910 | 6910 | ||
| 6911 | /* Encode filename, current directory and parameters, and | 6911 | /* Encode filename, current directory and parameters, and |
| 6912 | convert operation to UTF-16. */ | 6912 | convert operation to UTF-16. */ |
| 6913 | current_dir = ENCODE_FILE (current_dir); | ||
| 6914 | filename_to_utf16 (SSDATA (current_dir), current_dir_w); | 6913 | filename_to_utf16 (SSDATA (current_dir), current_dir_w); |
| 6915 | if (STRINGP (document)) | 6914 | filename_to_utf16 (SSDATA (document), document_w); |
| 6916 | { | 6915 | doc_w = document_w; |
| 6917 | document = ENCODE_FILE (document); | ||
| 6918 | filename_to_utf16 (SSDATA (document), document_w); | ||
| 6919 | doc_w = document_w; | ||
| 6920 | } | ||
| 6921 | if (STRINGP (parameters)) | 6916 | if (STRINGP (parameters)) |
| 6922 | { | 6917 | { |
| 6923 | int len; | 6918 | int len; |
| @@ -6954,14 +6949,9 @@ an integer representing a ShowWindow flag: | |||
| 6954 | { | 6949 | { |
| 6955 | char document_a[MAX_PATH], current_dir_a[MAX_PATH]; | 6950 | char document_a[MAX_PATH], current_dir_a[MAX_PATH]; |
| 6956 | 6951 | ||
| 6957 | current_dir = ENCODE_FILE (current_dir); | ||
| 6958 | filename_to_ansi (SSDATA (current_dir), current_dir_a); | 6952 | filename_to_ansi (SSDATA (current_dir), current_dir_a); |
| 6959 | if (STRINGP (document)) | 6953 | filename_to_ansi (SSDATA (document), document_a); |
| 6960 | { | 6954 | doc_a = document_a; |
| 6961 | ENCODE_FILE (document); | ||
| 6962 | filename_to_ansi (SSDATA (document), document_a); | ||
| 6963 | doc_a = document_a; | ||
| 6964 | } | ||
| 6965 | if (STRINGP (parameters)) | 6955 | if (STRINGP (parameters)) |
| 6966 | { | 6956 | { |
| 6967 | parameters = ENCODE_SYSTEM (parameters); | 6957 | parameters = ENCODE_SYSTEM (parameters); |