1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-08 15:35:02 +00:00

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
This commit is contained in:
Pieter van Oostrum 2020-01-16 20:21:37 +01:00 committed by Eli Zaretskii
parent 74b151195d
commit 4217bc229b
2 changed files with 2 additions and 3 deletions

View File

@ -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

View File

@ -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