summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2011-09-13 08:57:29 -0600
committerEric Schulte <schulte.eric@gmail.com>2011-09-13 08:57:29 -0600
commit597e1eb4fe7b2674c2d5233f215217f7b35e4035 (patch)
treeed077c282ccca41abd1d9320c947f9f44f75f4ca
parentdbf0e6d5bcbe94c8ee57d68889d3c25bf9cdef55 (diff)
downloadorg-mode-597e1eb4fe7b2674c2d5233f215217f7b35e4035.tar.gz
Don't error on empty code block body.
* lisp/ob.el (org-babel-parse-src-block-match): Don't error on empty code block body.
-rw-r--r--lisp/ob.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/ob.el b/lisp/ob.el
index 9f70c0b..7c00f64 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -1021,7 +1021,8 @@ may be specified in the current buffer."
(body (org-babel-clean-text-properties
(let* ((body (match-string 5))
(sub-length (- (length body) 1)))
- (if (string= "\n" (substring body sub-length))
+ (if (and (> sub-length 0)
+ (string= "\n" (substring body sub-length)))
(substring body 0 sub-length)
body))))
(preserve-indentation (or org-src-preserve-indentation