mfscanf : return good value for number of result. 14/12514/6
authorCedric Delamarre <cedric.delamarre@scilab-enterprises.com>
Thu, 12 Sep 2013 10:36:13 +0000 (12:36 +0200)
committerAntoine ELIAS <antoine.elias@scilab-enterprises.com>
Fri, 13 Sep 2013 13:46:05 +0000 (15:46 +0200)
commit2d36b8e71dab3dfc44af8e12ca7a98479e6d6c7c
tree042b46724ab579854788c9f993b2c03ff4bd3e0b
parentacb67c1f9d1fbdf0f170be55bc0005053ee063c8
mfscanf : return good value for number of result.

n=5
A=matrix(1:25, 5, 5);
A1=strcat(string(A),' ','c');
tmpf=TMPDIR+'/fscanf.rep';
mputl(A1,tmpf);
F='%d';F=strcat(F(ones(1,n+1)),' ');
fd=mopen(tmpf,'r');
[n,a,b,c,d,e,f]=mfscanf(-1,fd,F)// n = 6
[n,a,b,c,d,e,f]=mfscanf(-1,fd,F)// n = 1
[n,a,b,c,d,e,f]=mfscanf(-1,fd,F)// n = -1

test_run("fileio","mfscanf",["no_check_error_output" ]);
test_run("fileio","msscanf",["no_check_error_output" ]);
test_run("fileio","bug_1023",["no_check_error_output" ]);
test_run("fileio","bug_2107",["no_check_error_output" ]);
test_run("fileio","bug_2453",["no_check_error_output" ]);

Change-Id: I02f751ed224d0d56fc14ce6d1cd0df9ba1dd706c
scilab/modules/fileio/sci_gateway/cpp/sci_mfscanf.cpp