Browse Source

org.el: Fix recursive regexp backtracking

* org.el (org-link-search): Avoid recursive regexp backtracking behavior
when following search links.

<http://article.gmane.org/gmane.emacs.orgmode/100010>

TINYCHANGE
Philip 9 years ago
parent
commit
453492ca95
1 changed files with 4 additions and 4 deletions
  1. 4 4
      lisp/org.el

+ 4 - 4
lisp/org.el

@@ -11131,18 +11131,18 @@ of matched result, with is either `dedicated' or `fuzzy'."
 				      "\\[[0-9]*\\(?:%\\|/[0-9]*\\)\\]"
 				      wspaceopt
 				      "\\)"))
-		      (sep (concat "\\(?:" wspace "+\\|" cookie "+\\)"))
+		      (sep (concat "\\(?:\\(?:" wspace "\\|" cookie "\\)+\\)"))
 		      (re (concat
 			   org-outline-regexp-bol
 			   "\\(?:" org-todo-regexp "[ \t]+\\)?"
 			   "\\(?:\\[#.\\][ \t]+\\)?"
 			   "\\(?:" org-comment-string "[ \t]+\\)?"
-			   sep "*"
+			   sep "?"
 			   (let ((title (mapconcat #'regexp-quote
 						   words
-						   (concat sep "+"))))
+						   sep)))
 			     (if starred (substring title 1) title))
-			   sep "*"
+			   sep "?"
 			   (org-re "\\(?:[ \t]+:[[:alnum:]_@#%%:]+:\\)?")
 			   "[ \t]*$")))
 		 (goto-char (point-min))