瀏覽代碼

imenu: Added a check that looking-at succeeds before using the match results.

* lisp/org.el (org-imenu-get-tree): Check that looking-at succeeds before using match results.

TINYCHANGE
Ilya Shlyakhter 13 年之前
父節點
當前提交
ca41982ad4
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      lisp/org.el

+ 2 - 2
lisp/org.el

@@ -21048,8 +21048,8 @@ Show the heading too, if it is currently invisible."
 	(goto-char (point-max))
 	(while (re-search-backward re nil t)
 	  (setq level (org-reduced-level (funcall outline-level)))
-	  (when (<= level n)
-	    (looking-at org-complex-heading-regexp)
+	  (when (and (<= level n)
+		     (looking-at org-complex-heading-regexp))
 	    (setq head (org-link-display-format
 			(org-match-string-no-properties 4))
 		  m (org-imenu-new-marker))