summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2011-02-06 15:00:08 +0000
committerDan Davison <dandavison7@gmail.com>2011-02-13 11:03:58 +0000
commita8f2163d76e7936ee22e2a0a4324226d8f771819 (patch)
tree18059741f593b5eb23c16a4f4c027837607c9371
parent10f5ac643daf7d9e6bff87d6b5f7eafb6f6f30b4 (diff)
downloadorg-mode-a8f2163d76e7936ee22e2a0a4324226d8f771819.tar.gz
ob: `substring' comparison instead of regexp matching
* lisp/ob.el (org-babel-script-escape): Use `substring' comparison instead of regexp matching Workaround for regexp limitation, e.g. (string-match "^\\[.+\\]$" (concat "[" (mapconcat (lambda (i) "x") (number-sequence 1 33500) "") "]")) gives "Stack overflow in regexp matcher" in several current builds.
-rw-r--r--lisp/ob.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/ob.el b/lisp/ob.el
index aa804cd..d89892f 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -1857,7 +1857,10 @@ block but are passed literally to the \"example-block\"."
"Safely convert tables into elisp lists."
(let (in-single in-double out)
(org-babel-read
- (if (and (stringp str) (string-match "^\\[.+\\]$" str))
+ (if (and (stringp str)
+ (> (length str) 2)
+ (string-equal "[" (substring str 0 1))
+ (string-equal "]" (substring str -1)))
(org-babel-read
(concat
"'"