emacs-diffs
[Top][All Lists]
Advanced

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

emacs-27 4217bc2: Fix infloop in shell.el


From: Eli Zaretskii
Subject: emacs-27 4217bc2: Fix infloop in shell.el
Date: Sat, 18 Jan 2020 04:54:45 -0500 (EST)

branch: emacs-27
commit 4217bc229b8d1614b3b5c44fd1dadb775ed1ef4a
Author: Pieter van Oostrum <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix infloop in shell.el
    
    * test/lisp/shell-tests.el (shell-tests-completion-before-semi):
    Amend the shell.el tests to catch errors such as bug#39057.
    
    * lisp/shell.el (shell--parse-pcomplete-arguments): Skip the
    semi-colon as well.  This avoids inflooping when a semi-colon is
    typed by the user.  (Bug#39057)
    
    Copyright-paperwork-exempt: yes
---
 lisp/shell.el            | 2 +-
 test/lisp/shell-tests.el | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/lisp/shell.el b/lisp/shell.el
index 98e830e..ecebf93 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -428,7 +428,7 @@ Thus, this does not include the shell's current directory.")
     (save-excursion
       (goto-char begin)
       (while (< (point) end)
-       (skip-chars-forward " \t\n")
+       (skip-chars-forward " \t\n;")
        (push (point) begins)
         (let ((arg ()))
           (while (looking-at
diff --git a/test/lisp/shell-tests.el b/test/lisp/shell-tests.el
index 6d262f8..7113cb9 100644
--- a/test/lisp/shell-tests.el
+++ b/test/lisp/shell-tests.el
@@ -34,8 +34,7 @@
   (with-temp-buffer
     (shell-mode)
     (insert "cd ba;")
-    (forward-char -1)
     (should (equal (shell--parse-pcomplete-arguments)
-                   '(("cd" "ba") 1 4)))))
+                   '(("cd" "ba" "") 1 4)))))
 
 ;;; shell-tests.el ends here



reply via email to

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