branch: externals/matlab-mode
commit 6f16c847365fad5c5adae0f818cc5d1409136dbb
Author: Xavier Raynaud <xavier.rayn...@sintef.no>
Commit: Xavier Raynaud <xavier.rayn...@sintef.no>

    fix in emacsrunregion regarding call to regexp
---
 toolbox/emacsrunregion.m | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/toolbox/emacsrunregion.m b/toolbox/emacsrunregion.m
index 5517cd8f81..8153df45a5 100644
--- a/toolbox/emacsrunregion.m
+++ b/toolbox/emacsrunregion.m
@@ -44,8 +44,7 @@ function emacsrunregion(file, startchar, endchar)
 
     % See if startchar and endchar are on the first column of a lines and if 
so display that. Note,
     % fileContents can contain POSIX newlines (LF) or be Windows CRFL (13, 10) 
line endings.
-    if (startchar == 1 || fileContents(startchar-1) == newline) && ...
-            regexp(fileContents(endchar), '[\r\n]', 'once')
+    if (startchar == 1 || fileContents(startchar-1) == newline) && 
~isempty(regexp(fileContents(endchar), '[\r\n]', 'once'))
         startLineNum = length(strfind(fileContents(1:startchar), newline)) + 1;
         endLineNum = length(strfind(fileContents(1:endchar), newline));
         if fileContents(endchar) == 13 || endchar == length(fileContents)

Reply via email to