# HG changeset patch # User John W. Eaton # Date 1296128272 18000 # Node ID b22c00315df567b16439ddc8bd794fe2e37df133 # Parent 1860ce6c30d0a701a8d3259b7af8b58855cadf2e dlmread: skip leading whitespace on each line diff -r 1860ce6c30d0 -r b22c00315df5 src/ChangeLog --- a/src/ChangeLog Thu Jan 27 06:16:50 2011 -0500 +++ b/src/ChangeLog Thu Jan 27 06:37:52 2011 -0500 @@ -1,3 +1,8 @@ +2011-01-27 John W. Eaton + + * DLD-FUNCTIONS/dlmread.cc (Fdlmread): Skip leading whitespace + on each line. + 2011-01-27 John W. Eaton * ov-struct.cc (octave_struct::subsasgn, diff -r 1860ce6c30d0 -r b22c00315df5 src/DLD-FUNCTIONS/dlmread.cc --- a/src/DLD-FUNCTIONS/dlmread.cc Thu Jan 27 06:16:50 2011 -0500 +++ b/src/DLD-FUNCTIONS/dlmread.cc Thu Jan 27 06:37:52 2011 -0500 @@ -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 ();