From c2585be9d03ac38e442fc1314e398499afb87558 Mon Sep 17 00:00:00 2001
From: Jacques Grelet <jacques.grelet@ird.fr>
Date: Wed, 1 Feb 2017 16:24:29 +0000
Subject: [PATCH] Bug fix: the last line of the .ini file was never read

---
 tsg_tools/csv2btl/csv2btl.m | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/tsg_tools/csv2btl/csv2btl.m b/tsg_tools/csv2btl/csv2btl.m
index 91171f7..517732d 100644
--- a/tsg_tools/csv2btl/csv2btl.m
+++ b/tsg_tools/csv2btl/csv2btl.m
@@ -29,18 +29,12 @@ if (fid_ini ~= -1)
     
     % test the end-of-file
     % --------------------
-    while true
+    while ~feof(fid_ini)
         
         % read next line
         % --------------
         inputText = textscan(fid_ini, '%s', 1, 'delimiter', '\n');
         
-        % end of file, quit loop
-        % ----------------------
-        if feof(fid_ini)
-            break
-        end
-        
         for ii = {'repIn', 'repOut'}
             
             % get key, use char because i is cell
@@ -64,8 +58,7 @@ if (fid_ini ~= -1)
                 fprintf('%s -> %s\n', clef, cfg.(clef));
                 continue
             end
-        end
-        
+        end  
     end  % end of while loop
     
     % close .ini file
-- 
GitLab