# HG changeset patch # User Ethan Biery # Date 1443731593 -7200 # Node ID 66adbb6e88adee55a85619d2869f26029bbc9784 # Parent bbe6a846d8ac938b17764dc5175407c2e7714268 textread.m, textscan.m: always remove headerlines args before invoking strread (bug #46080) diff -r bbe6a846d8ac -r 66adbb6e88ad scripts/io/textread.m --- a/scripts/io/textread.m Mon Sep 28 06:24:37 2015 -0400 +++ b/scripts/io/textread.m Thu Oct 01 22:33:13 2015 +0200 @@ -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); diff -r bbe6a846d8ac -r 66adbb6e88ad scripts/io/textscan.m --- a/scripts/io/textscan.m Mon Sep 28 06:24:37 2015 -0400 +++ b/scripts/io/textscan.m Thu Oct 01 22:33:13 2015 +0200 @@ -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);