Mercurial > hg > octave-nkf
changeset 20775:66adbb6e88ad stable
textread.m, textscan.m: always remove headerlines args before invoking strread (bug #46080)
author | Ethan Biery <ebiery@lutron.com> |
---|---|
date | Thu, 01 Oct 2015 22:33:13 +0200 |
parents | bbe6a846d8ac |
children | 1d6ab08edcde |
files | scripts/io/textread.m scripts/io/textscan.m |
diffstat | 2 files changed, 2 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/io/textread.m +++ b/scripts/io/textread.m @@ -143,11 +143,10 @@ ## Beware of zero valued headerline, fskipl would skip to EOF if (varargin{headerlines + 1} > 0) fskipl (fid, varargin{headerlines + 1}); - varargin(headerlines:headerlines+1) = []; - nargin = nargin - 2; elseif (varargin{headerlines + 1} < 0) warning ("textread: negative headerline value ignored"); endif + varargin(headerlines:headerlines+1) = []; endif st_pos = ftell (fid);
--- a/scripts/io/textscan.m +++ b/scripts/io/textscan.m @@ -202,11 +202,11 @@ if (args{headerlines + 1} > 0) ## Beware of zero valued headerline, fskipl would skip to EOF fskipl (fid, args{headerlines + 1}); - args(headerlines:headerlines+1) = []; st_pos = ftell (fid); elseif (args{headerlines + 1} < 0) warning ("textscan.m: negative headerline value ignored"); endif + args(headerlines:headerlines+1) = []; endif ## Read a first file chunk. Rest follows after endofline processing [str, count] = fscanf (fid, "%c", BUFLENGTH);