emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100367: Fix bug #6684 with shell


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r100367: Fix bug #6684 with shell pipelines on MS-Windows.
Date: Sun, 09 Jan 2011 19:52:57 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100367
committer: Eli Zaretskii <address@hidden>
branch nick: emacs-23
timestamp: Sun 2011-01-09 19:52:57 +0200
message:
  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.
modified:
  lisp/ChangeLog
  lisp/jka-compr.el
  lisp/progmodes/grep.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-01-08 22:15:51 +0000
+++ b/lisp/ChangeLog    2011-01-09 17:52:57 +0000
@@ -1,3 +1,9 @@
+2011-01-09  Eli Zaretskii  <address@hidden>
+
+       * progmodes/grep.el (grep-compute-defaults): Quote the program
+       file name after the pipe symbol in Grep templates.  (Bug#6784)
+       * jka-compr.el (jka-compr-partial-uncompress): Likewise.
+
 2011-01-08  Lennart Borgman  <address@hidden>
 
        * buff-menu.el (Buffer-menu-buffer-list): New var.

=== modified file 'lisp/jka-compr.el'
--- a/lisp/jka-compr.el 2011-01-02 23:50:46 +0000
+++ b/lisp/jka-compr.el 2011-01-09 17:52:57 +0000
@@ -166,8 +166,11 @@
          (unwind-protect
              (or (memq (call-process
                         jka-compr-shell infile t nil "-c"
+                        ;; Windows shells need the program file name
+                        ;; after the pipe symbol be quoted if they use
+                        ;; forward slashes as directory separators.
                         (format
-                         "%s %s 2> %s | %s bs=%d skip=%d %s 2> %s"
+                         "%s %s 2> %s | \"%s\" bs=%d skip=%d %s 2> %s"
                          prog
                          (mapconcat 'identity args " ")
                          err-file

=== modified file 'lisp/progmodes/grep.el'
--- a/lisp/progmodes/grep.el    2011-01-02 23:50:46 +0000
+++ b/lisp/progmodes/grep.el    2011-01-09 17:52:57 +0000
@@ -561,7 +561,10 @@
        (unless grep-find-command
          (setq grep-find-command
                (cond ((eq grep-find-use-xargs 'gnu)
-                      (format "%s . -type f -print0 | %s -0 -e %s"
+                      ;; Windows shells need the program file name
+                      ;; after the pipe symbol be quoted if they use
+                      ;; forward slashes as directory separators.
+                      (format "%s . -type f -print0 | \"%s\" -0 -e %s"
                               find-program xargs-program grep-command))
                      ((eq grep-find-use-xargs 'exec)
                       (let ((cmd0 (format "%s . -type f -exec %s"
@@ -572,21 +575,21 @@
                                  (shell-quote-argument ";"))
                          (1+ (length cmd0)))))
                      (t
-                      (format "%s . -type f -print | %s %s"
+                      (format "%s . -type f -print | \"%s\" %s"
                               find-program xargs-program grep-command)))))
        (unless grep-find-template
          (setq grep-find-template
                (let ((gcmd (format "%s <C> %s <R>"
                                    grep-program grep-options)))
                  (cond ((eq grep-find-use-xargs 'gnu)
-                        (format "%s . <X> -type f <F> -print0 | %s -0 -e %s"
+                        (format "%s . <X> -type f <F> -print0 | \"%s\" -0 -e 
%s"
                                 find-program xargs-program gcmd))
                        ((eq grep-find-use-xargs 'exec)
                         (format "%s . <X> -type f <F> -exec %s {} %s %s"
                                 find-program gcmd null-device
                                 (shell-quote-argument ";")))
                        (t
-                        (format "%s . <X> -type f <F> -print | %s %s"
+                        (format "%s . <X> -type f <F> -print | \"%s\" %s"
                                 find-program xargs-program gcmd))))))))
     (when (eq grep-highlight-matches 'auto-detect)
       (setq grep-highlight-matches


reply via email to

[Prev in Thread] Current Thread [Next in Thread]