1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-04 11:40:22 +00:00

Fix infinite loop in sh-script's SMIE code

* lisp/progmodes/sh-script.el (sh-smie-sh-forward-token): Fix infinite
loop (bug#21747).
This commit is contained in:
Tassilo Horn 2015-10-26 08:01:18 +01:00
parent 3cdeda60c5
commit 1bab3cefc1

View File

@ -1920,10 +1920,11 @@ Does not preserve point."
;; Pretend the here-document is a "newline representing a
;; semi-colon", since the here-doc otherwise covers the newline(s).
";")
(let ((semi (sh-smie--newline-semi-p)))
(forward-line 1)
(if (or semi (eobp)) ";"
(sh-smie-sh-forward-token))))
(unless (eobp)
(let ((semi (sh-smie--newline-semi-p)))
(forward-line 1)
(if (or semi (eobp)) ";"
(sh-smie-sh-forward-token)))))
(forward-comment (point-max))
(cond
((looking-at "\\\\\n") (forward-line 1) (sh-smie-sh-forward-token))