Browse Source

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.
Eric Schulte 13 years ago
parent
commit
597e1eb4fe
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lisp/ob.el

+ 2 - 1
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