Mercurial > hg > octave-jordi
changeset 12182:99b00a9a5147
dlmread: skip leading whitespace on each line
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 27 Jan 2011 06:37:52 -0500 |
parents | 88ff30dcc048 |
children | b4d26c65e7e6 |
files | src/ChangeLog src/DLD-FUNCTIONS/dlmread.cc |
diffstat | 2 files changed, 10 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-01-27 John W. Eaton <jwe@octave.org> + + * DLD-FUNCTIONS/dlmread.cc (Fdlmread): Skip leading whitespace + on each line. + 2011-01-27 John W. Eaton <jwe@octave.org> * ov-struct.cc (octave_struct::subsasgn,
--- a/src/DLD-FUNCTIONS/dlmread.cc +++ b/src/DLD-FUNCTIONS/dlmread.cc @@ -342,8 +342,9 @@ if (cmax == 0) { - // Try to estimate the number of columns. - size_t pos1 = 0; + // Try to estimate the number of columns. Skip leading + // whitespace. + size_t pos1 = line.find_first_not_of (" \t"); do { size_t pos2 = line.find_first_of (sep, pos1); @@ -376,7 +377,8 @@ r = (r > i + 1 ? r : i + 1); j = 0; - size_t pos1 = 0; + // Skip leading whitespace. + size_t pos1 = line.find_first_not_of (" \t"); do { octave_quit ();