emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp/net tramp.el


From: Michael Albinus
Subject: [Emacs-diffs] emacs/lisp/net tramp.el
Date: Thu, 16 Jul 2009 10:23:47 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Michael Albinus <albinus>       09/07/16 10:23:47

Modified files:
        lisp/net       : tramp.el 

Log message:
        * net/tramp.el (tramp-wait-for-output): Handle the case when
        commands do not return a newline but a null byte before the shell
        prompt.  (Bug#3858)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/net/tramp.el?cvsroot=emacs&r1=1.243&r2=1.244

Patches:
Index: tramp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/net/tramp.el,v
retrieving revision 1.243
retrieving revision 1.244
diff -u -b -r1.243 -r1.244
--- tramp.el    8 Jul 2009 12:40:58 -0000       1.243
+++ tramp.el    16 Jul 2009 10:23:46 -0000      1.244
@@ -3898,15 +3898,15 @@
 
       ;; Determine output.
       (cond
-       ;; Just a buffer
+       ;; Just a buffer.
        ((bufferp destination)
        (setq outbuf destination))
-       ;; A buffer name
+       ;; A buffer name.
        ((stringp destination)
        (setq outbuf (get-buffer-create destination)))
        ;; (REAL-DESTINATION ERROR-DESTINATION)
        ((consp destination)
-       ;; output
+       ;; output.
        (cond
         ((bufferp (car destination))
          (setq outbuf (car destination)))
@@ -3914,7 +3914,7 @@
          (setq outbuf (get-buffer-create (car destination))))
         ((car destination)
          (setq outbuf (current-buffer))))
-       ;; stderr
+       ;; stderr.
        (cond
         ((stringp (cadr destination))
          (setcar (cdr destination) (expand-file-name (cadr destination)))
@@ -3927,7 +3927,7 @@
            (setq stderr (tramp-make-tramp-temp-file v)
                  tmpstderr (tramp-make-tramp-file-name
                             method user host stderr))))
-        ;; stderr to be discarded
+        ;; stderr to be discarded.
         ((null (cadr destination))
          (setq stderr "/dev/null"))))
        ;; 't
@@ -6660,10 +6660,14 @@
 (defun tramp-wait-for-output (proc &optional timeout)
   "Wait for output from remote rsh command."
   (with-current-buffer (process-buffer proc)
-    ;; Initially, `tramp-end-of-output' is "$ ".  There might be
-    ;; leading escape sequences, which must be ignored.
-    (let* ((regexp (format "^[^$\n]*%s\r?$" (regexp-quote 
tramp-end-of-output)))
-          (found (tramp-wait-for-regexp proc timeout regexp)))
+    (let* (;; Initially, `tramp-end-of-output' is "$ ".  There might
+          ;; be leading escape sequences, which must be ignored.
+          (regexp (format "[^$\n]*%s\r?$" (regexp-quote tramp-end-of-output)))
+          ;; Sometimes, the commands do not return a newline but a
+          ;; null byte before the shell prompt, for example "git
+          ;; ls-files -c -z ...".
+          (regexp1 (format "\\(^\\|\000\\)%s" regexp))
+          (found (tramp-wait-for-regexp proc timeout regexp1)))
       (if found
          (let (buffer-read-only)
            (goto-char (point-max))




reply via email to

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