From c548b2a91ebedde0d625fe53f5c9f86b0911c45d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?=
 <stephane.adjemian@univ-lemans.fr>
Date: Sun, 19 Mar 2017 12:10:39 +0100
Subject: [PATCH] Bug fix.

Was not working if the second line of the test was empty and had no trailing space.
---
 src/mtest.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mtest.m b/src/mtest.m
index 617aab4..3025529 100644
--- a/src/mtest.m
+++ b/src/mtest.m
@@ -86,7 +86,7 @@ for i=1:nn
     tid = fopen([FNAME '_test_' int2str(i) '.m'],'w');
     fprintf(tid,['function [T,t,LOG] = ' FNAME '_test_' int2str(i) '()\n']);
     fprintf(tid,['try\n']);
-    if isequal(file{b1(i)+1}(1:3), '%$ ') || isequal(file{b1(i)+1}(1:2), '%$')
+    if (length(file{b1(i)+1})>2 && isequal(file{b1(i)+1}(1:3), '%$ ')) || (length(file{b1(i)+1})>1 && isequal(file{b1(i)+1}(1:2), '%$'))
         remove_first_columns = true;
     else
         remove_first_columns = false;
-- 
GitLab