# HG changeset patch # User John W. Eaton # Date 1296128272 18000 # Node ID 99b00a9a5147a79cca6e9533fd672beed00ba27d # Parent 88ff30dcc0487623a2ef4429897f5ebc3ebbc05e dlmread: skip leading whitespace on each line diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -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 --git a/src/DLD-FUNCTIONS/dlmread.cc b/src/DLD-FUNCTIONS/dlmread.cc --- 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 ();