diff options
author | Aaron Ecay <aaronecay@gmail.com> | 2014-09-01 00:49:03 -0400 |
---|---|---|
committer | Aaron Ecay <aaronecay@gmail.com> | 2014-09-01 00:52:13 -0400 |
commit | a4a1d85ed0d62e7713d515b967b1bc1580ec398d (patch) | |
tree | 95074bf28184f6aeb3ae8e2d79246b0676d6b887 | |
parent | 2df0785fbdcac4e343c9ac801b6c1cfcf3887bbf (diff) | |
download | org-mode-a4a1d85ed0d62e7713d515b967b1bc1580ec398d.tar.gz |
ob-comint.el: Fix bug.
* lisp/ob-comint.el (org-babel-comint-eval-invisibly-and-wait-for-file):
Fix bug.
The intention is to test whether the string ends with a newline, so we
should just do that. Otherwise:
(string-match "\n$" "foo\n\nbar") ;; => 3 => :-(
-rw-r--r-- | lisp/ob-comint.el | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/ob-comint.el b/lisp/ob-comint.el index 0b97424..7c768d3 100644 --- a/lisp/ob-comint.el +++ b/lisp/ob-comint.el @@ -148,7 +148,7 @@ FILE exists at end of evaluation." (if (file-exists-p file) (delete-file file)) (process-send-string (get-buffer-process buffer) - (if (string-match "\n$" string) string (concat string "\n"))) + (if (= (aref string (1- (length string))) ?\n) string (concat string "\n"))) ;; From Tramp 2.1.19 the following cache flush is not necessary (if (file-remote-p default-directory) (let (v) |