diff options
| author | Alan Mackenzie | 2018-11-24 10:31:53 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2018-11-24 10:31:53 +0000 |
| commit | 9877c03293241091ba4069002d4dc4d74b557414 (patch) | |
| tree | a177500da6131f25060d7ce9d40aafbd2bddab27 | |
| parent | 25a4205271f5550a34b5cfbf484fe7f16410d1f6 (diff) | |
| download | emacs-9877c03293241091ba4069002d4dc4d74b557414.tar.gz emacs-9877c03293241091ba4069002d4dc4d74b557414.zip | |
Fix bug #33416, where typing a ) in a comment at EOB caused a loop (CC Mode).
* lisp/progmodes/cc-mode.el (c-fl-decl-start): A c-forward-syntactic-ws leaves
point inside whitespace when moving over a comment at EOB which has no
terminating LF. Check this possibility and correct for it.
| -rw-r--r-- | lisp/progmodes/cc-mode.el | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 664f01012b8..424cde52474 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el | |||
| @@ -1512,7 +1512,10 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".") | |||
| 1512 | (c-syntactic-skip-backward "^;{}" bod-lim t) | 1512 | (c-syntactic-skip-backward "^;{}" bod-lim t) |
| 1513 | (> (point) bod-lim) | 1513 | (> (point) bod-lim) |
| 1514 | (progn (c-forward-syntactic-ws) | 1514 | (progn (c-forward-syntactic-ws) |
| 1515 | (setq bo-decl (point)) | 1515 | ;; Have we got stuck in a comment at EOB? |
| 1516 | (not (and (eobp) | ||
| 1517 | (c-literal-start)))) | ||
| 1518 | (progn (setq bo-decl (point)) | ||
| 1516 | (or (not (looking-at c-protection-key)) | 1519 | (or (not (looking-at c-protection-key)) |
| 1517 | (c-forward-keyword-clause 1))) | 1520 | (c-forward-keyword-clause 1))) |
| 1518 | (progn | 1521 | (progn |