aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorMartin Stjernholm2002-08-20 21:59:10 +0000
committerMartin Stjernholm2002-08-20 21:59:10 +0000
commit0e35704fe37533a3b089c0b5fa8303e98baba562 (patch)
treea6b0126b0d2b8adeb389d3b6d85ee8f26ee46f61 /lisp/progmodes
parent23d468dadde98fecb74c19b8be0917f7aa20cff6 (diff)
downloademacs-0e35704fe37533a3b089c0b5fa8303e98baba562.tar.gz
emacs-0e35704fe37533a3b089c0b5fa8303e98baba562.zip
(c-forward-syntactic-ws): Fixed a bug that could cause an infinite
loop if something that looks like a macro begins in the middle of a line. (c-parse-state): Fixed a bug that could cause `c-state-cache' to contain two conses in sequence when there's an unbalanced open paren in a macro.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/cc-engine.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 3994c5cc22c..4fdfbcf9502 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -642,8 +642,9 @@ specified."
642 (forward-char)) 642 (forward-char))
643 ;; Skip preprocessor directives. 643 ;; Skip preprocessor directives.
644 ((and (looking-at "#[ \t]*[a-zA-Z0-9!]") 644 ((and (looking-at "#[ \t]*[a-zA-Z0-9!]")
645 (progn (skip-chars-backward " \t") 645 (save-excursion
646 (bolp))) 646 (skip-chars-backward " \t")
647 (bolp)))
647 (end-of-line) 648 (end-of-line)
648 (while (and (<= (point) lim) 649 (while (and (<= (point) lim)
649 (eq (char-before) ?\\) 650 (eq (char-before) ?\\)
@@ -1245,6 +1246,11 @@ you need both the type of a literal and its limits."
1245 (setq c-state-cache (cdr c-state-cache))) 1246 (setq c-state-cache (cdr c-state-cache)))
1246 (setq pairs (car pairs)) 1247 (setq pairs (car pairs))
1247 (setcar pairs (1- (car pairs))) 1248 (setcar pairs (1- (car pairs)))
1249 (when (consp (car-safe c-state-cache))
1250 ;; There could already be a cons first in `c-state-cache'
1251 ;; if we've jumped over an unbalanced open paren in a
1252 ;; macro below.
1253 (setq c-state-cache (cdr c-state-cache)))
1248 (setq c-state-cache (cons pairs c-state-cache))) 1254 (setq c-state-cache (cons pairs c-state-cache)))
1249 (if last-pos 1255 (if last-pos
1250 ;; Prepare to loop, but record the open paren only if it's 1256 ;; Prepare to loop, but record the open paren only if it's