diff options
| author | Eli Zaretskii | 2011-01-09 19:52:57 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2011-01-09 19:52:57 +0200 |
| commit | 88ecd0a566155169b0c720d45f6978537e2f4a36 (patch) | |
| tree | 673c5391b8614eda4f8d5388956cc73a0a802571 | |
| parent | 320912fb3d938746b4a74750f366c6e698e91a34 (diff) | |
| download | emacs-88ecd0a566155169b0c720d45f6978537e2f4a36.tar.gz emacs-88ecd0a566155169b0c720d45f6978537e2f4a36.zip | |
Fix bug #6684 with shell pipelines on MS-Windows.
progmodes/grep.el (grep-compute-defaults): Quote the program
file name after the pipe symbol in Grep templates.
jka-compr.el (jka-compr-partial-uncompress): Likewise.
Fixes: debbugs:6784
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/jka-compr.el | 5 | ||||
| -rw-r--r-- | lisp/progmodes/grep.el | 11 |
3 files changed, 17 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0769c3d4c80..688f32e5a72 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2011-01-09 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * progmodes/grep.el (grep-compute-defaults): Quote the program | ||
| 4 | file name after the pipe symbol in Grep templates. (Bug#6784) | ||
| 5 | * jka-compr.el (jka-compr-partial-uncompress): Likewise. | ||
| 6 | |||
| 1 | 2011-01-08 Lennart Borgman <lennart.borgman@gmail.com> | 7 | 2011-01-08 Lennart Borgman <lennart.borgman@gmail.com> |
| 2 | 8 | ||
| 3 | * buff-menu.el (Buffer-menu-buffer-list): New var. | 9 | * buff-menu.el (Buffer-menu-buffer-list): New var. |
diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el index 635f3ce8468..32f3d6d1f58 100644 --- a/lisp/jka-compr.el +++ b/lisp/jka-compr.el | |||
| @@ -166,8 +166,11 @@ to keep: LEN chars starting BEG chars from the beginning." | |||
| 166 | (unwind-protect | 166 | (unwind-protect |
| 167 | (or (memq (call-process | 167 | (or (memq (call-process |
| 168 | jka-compr-shell infile t nil "-c" | 168 | jka-compr-shell infile t nil "-c" |
| 169 | ;; Windows shells need the program file name | ||
| 170 | ;; after the pipe symbol be quoted if they use | ||
| 171 | ;; forward slashes as directory separators. | ||
| 169 | (format | 172 | (format |
| 170 | "%s %s 2> %s | %s bs=%d skip=%d %s 2> %s" | 173 | "%s %s 2> %s | \"%s\" bs=%d skip=%d %s 2> %s" |
| 171 | prog | 174 | prog |
| 172 | (mapconcat 'identity args " ") | 175 | (mapconcat 'identity args " ") |
| 173 | err-file | 176 | err-file |
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index dac14d07ef8..dd6dc025d5b 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el | |||
| @@ -561,7 +561,10 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'." | |||
| 561 | (unless grep-find-command | 561 | (unless grep-find-command |
| 562 | (setq grep-find-command | 562 | (setq grep-find-command |
| 563 | (cond ((eq grep-find-use-xargs 'gnu) | 563 | (cond ((eq grep-find-use-xargs 'gnu) |
| 564 | (format "%s . -type f -print0 | %s -0 -e %s" | 564 | ;; Windows shells need the program file name |
| 565 | ;; after the pipe symbol be quoted if they use | ||
| 566 | ;; forward slashes as directory separators. | ||
| 567 | (format "%s . -type f -print0 | \"%s\" -0 -e %s" | ||
| 565 | find-program xargs-program grep-command)) | 568 | find-program xargs-program grep-command)) |
| 566 | ((eq grep-find-use-xargs 'exec) | 569 | ((eq grep-find-use-xargs 'exec) |
| 567 | (let ((cmd0 (format "%s . -type f -exec %s" | 570 | (let ((cmd0 (format "%s . -type f -exec %s" |
| @@ -572,21 +575,21 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'." | |||
| 572 | (shell-quote-argument ";")) | 575 | (shell-quote-argument ";")) |
| 573 | (1+ (length cmd0))))) | 576 | (1+ (length cmd0))))) |
| 574 | (t | 577 | (t |
| 575 | (format "%s . -type f -print | %s %s" | 578 | (format "%s . -type f -print | \"%s\" %s" |
| 576 | find-program xargs-program grep-command))))) | 579 | find-program xargs-program grep-command))))) |
| 577 | (unless grep-find-template | 580 | (unless grep-find-template |
| 578 | (setq grep-find-template | 581 | (setq grep-find-template |
| 579 | (let ((gcmd (format "%s <C> %s <R>" | 582 | (let ((gcmd (format "%s <C> %s <R>" |
| 580 | grep-program grep-options))) | 583 | grep-program grep-options))) |
| 581 | (cond ((eq grep-find-use-xargs 'gnu) | 584 | (cond ((eq grep-find-use-xargs 'gnu) |
| 582 | (format "%s . <X> -type f <F> -print0 | %s -0 -e %s" | 585 | (format "%s . <X> -type f <F> -print0 | \"%s\" -0 -e %s" |
| 583 | find-program xargs-program gcmd)) | 586 | find-program xargs-program gcmd)) |
| 584 | ((eq grep-find-use-xargs 'exec) | 587 | ((eq grep-find-use-xargs 'exec) |
| 585 | (format "%s . <X> -type f <F> -exec %s {} %s %s" | 588 | (format "%s . <X> -type f <F> -exec %s {} %s %s" |
| 586 | find-program gcmd null-device | 589 | find-program gcmd null-device |
| 587 | (shell-quote-argument ";"))) | 590 | (shell-quote-argument ";"))) |
| 588 | (t | 591 | (t |
| 589 | (format "%s . <X> -type f <F> -print | %s %s" | 592 | (format "%s . <X> -type f <F> -print | \"%s\" %s" |
| 590 | find-program xargs-program gcmd)))))))) | 593 | find-program xargs-program gcmd)))))))) |
| 591 | (when (eq grep-highlight-matches 'auto-detect) | 594 | (when (eq grep-highlight-matches 'auto-detect) |
| 592 | (setq grep-highlight-matches | 595 | (setq grep-highlight-matches |