diff options
| author | Noam Postavsky | 2014-10-25 12:12:01 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2014-10-25 12:12:01 +0300 |
| commit | a91ff4f4b1d835cc2c723429c06ddcb357f807c8 (patch) | |
| tree | f32ac836d8644b60cbd6408acd4de9967c70e53a /test | |
| parent | b5dc75aed71ecb2310a6689e2f7082243aa7e4ab (diff) | |
| download | emacs-a91ff4f4b1d835cc2c723429c06ddcb357f807c8.tar.gz emacs-a91ff4f4b1d835cc2c723429c06ddcb357f807c8.zip | |
Fix bug #18745 with invoking Windows batch files with embedded whitespace.
src/w32proc.c (create_child): If calling a quoted batch file,
pass NULL for exe.
nt/cmdproxy.c (batch_file_p): New function.
(spawn): If calling a quoted batch file pass NULL for progname.
test/automated/process-tests.el (process-test-quoted-batfile): New test.
Diffstat (limited to 'test')
| -rw-r--r-- | test/ChangeLog | 5 | ||||
| -rw-r--r-- | test/automated/process-tests.el | 22 |
2 files changed, 27 insertions, 0 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index bb4b2fbdc49..fb19252cd34 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-10-22 Noam Postavsky <npostavs@users.sourceforget.net> | ||
| 2 | |||
| 3 | * test/automated/process-tests.el (process-test-quoted-batfile): | ||
| 4 | New test. | ||
| 5 | |||
| 1 | 2014-10-20 Glenn Morris <rgm@gnu.org> | 6 | 2014-10-20 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * Merge in all changes up to 24.4 release. | 8 | * Merge in all changes up to 24.4 release. |
diff --git a/test/automated/process-tests.el b/test/automated/process-tests.el index cd209bacaa6..6783a61d595 100644 --- a/test/automated/process-tests.el +++ b/test/automated/process-tests.el | |||
| @@ -50,4 +50,26 @@ | |||
| 50 | (should | 50 | (should |
| 51 | (process-test-sentinel-wait-function-working-p (lambda () (sit-for 0.01 t))))) | 51 | (process-test-sentinel-wait-function-working-p (lambda () (sit-for 0.01 t))))) |
| 52 | 52 | ||
| 53 | (when (eq system-type 'windows-nt) | ||
| 54 | (ert-deftest process-test-quoted-batfile () | ||
| 55 | "Check that Emacs hides CreateProcess deficiency (bug#18745)." | ||
| 56 | (let (batfile) | ||
| 57 | (unwind-protect | ||
| 58 | (progn | ||
| 59 | ;; CreateProcess will fail when both the bat file and 1st | ||
| 60 | ;; argument are quoted, so include spaces in both of those | ||
| 61 | ;; to force quoting. | ||
| 62 | (setq batfile (make-temp-file "echo args" nil ".bat")) | ||
| 63 | (with-temp-file batfile | ||
| 64 | (insert "@echo arg1 = %1, arg2 = %2\n")) | ||
| 65 | (with-temp-buffer | ||
| 66 | (call-process batfile nil '(t t) t "x &y") | ||
| 67 | (should (string= (buffer-string) "arg1 = \"x &y\", arg2 = \n"))) | ||
| 68 | (with-temp-buffer | ||
| 69 | (call-process-shell-command | ||
| 70 | (mapconcat #'shell-quote-argument (list batfile "x &y") " ") | ||
| 71 | nil '(t t) t) | ||
| 72 | (should (string= (buffer-string) "arg1 = \"x &y\", arg2 = \n")))) | ||
| 73 | (when batfile (delete-file batfile)))))) | ||
| 74 | |||
| 53 | (provide 'process-tests) | 75 | (provide 'process-tests) |