diff options
| author | Tassilo Horn | 2015-10-26 08:01:18 +0100 |
|---|---|---|
| committer | Tassilo Horn | 2015-10-26 08:01:18 +0100 |
| commit | 1bab3cefc133e06aaf4a48efb1623d1b458ab212 (patch) | |
| tree | 7f54f1d0a3b336d6fa03ccf3478a530afad4a30e | |
| parent | 3cdeda60c5c1c8e75aa2bbd7efa866a55ec2d150 (diff) | |
| download | emacs-1bab3cefc133e06aaf4a48efb1623d1b458ab212.tar.gz emacs-1bab3cefc133e06aaf4a48efb1623d1b458ab212.zip | |
Fix infinite loop in sh-script's SMIE code
* lisp/progmodes/sh-script.el (sh-smie-sh-forward-token): Fix infinite
loop (bug#21747).
| -rw-r--r-- | lisp/progmodes/sh-script.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index fbb4a90db40..baed27bb138 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -1920,10 +1920,11 @@ Does not preserve point." | |||
| 1920 | ;; Pretend the here-document is a "newline representing a | 1920 | ;; Pretend the here-document is a "newline representing a |
| 1921 | ;; semi-colon", since the here-doc otherwise covers the newline(s). | 1921 | ;; semi-colon", since the here-doc otherwise covers the newline(s). |
| 1922 | ";") | 1922 | ";") |
| 1923 | (let ((semi (sh-smie--newline-semi-p))) | 1923 | (unless (eobp) |
| 1924 | (forward-line 1) | 1924 | (let ((semi (sh-smie--newline-semi-p))) |
| 1925 | (if (or semi (eobp)) ";" | 1925 | (forward-line 1) |
| 1926 | (sh-smie-sh-forward-token)))) | 1926 | (if (or semi (eobp)) ";" |
| 1927 | (sh-smie-sh-forward-token))))) | ||
| 1927 | (forward-comment (point-max)) | 1928 | (forward-comment (point-max)) |
| 1928 | (cond | 1929 | (cond |
| 1929 | ((looking-at "\\\\\n") (forward-line 1) (sh-smie-sh-forward-token)) | 1930 | ((looking-at "\\\\\n") (forward-line 1) (sh-smie-sh-forward-token)) |