Merge remote-tracking branch 'origin/fastpath'

* origin/fastpath:
  fix handline of sets only containing a zero-length string.

Conflicts:
	src/input/readers/Ascii.cc
This commit is contained in:
Robin Sommer 2012-08-27 12:27:24 -07:00
commit 48c6bdf467
3 changed files with 8 additions and 3 deletions

View file

@ -348,9 +348,10 @@ Value* Ascii::EntryToVal(string s, FieldMapping field)
pos++; pos++;
} }
// Test if the string ends with a set_separator. If it does // Test if the string ends with a set_separator... or if the
// we have to push an zero-length val on top of it. // complete string is empty. In either of these cases we have
if ( *s.rbegin() == set_separator[0] ) // to push an empty val on top of it.
if ( s.empty() || *s.rbegin() == set_separator[0] )
{ {
lvals[pos] = EntryToVal("", field.subType()); lvals[pos] = EntryToVal("", field.subType());
if ( lvals[pos] == 0 ) if ( lvals[pos] == 0 )

View file

@ -7,6 +7,9 @@ testing
, ,
testing testing
}, s=[testing, ]], }, s=[testing, ]],
[6] = [s={
}, s=[]],
[1] = [s={ [1] = [s={
testing,testing,testing, testing,testing,testing,
}, s=[testing,testing,testing,]], }, s=[testing,testing,testing,]],

View file

@ -13,6 +13,7 @@
3 ,testing ,testing 3 ,testing ,testing
4 testing, testing, 4 testing, testing,
5 ,,, ,,, 5 ,,, ,,,
6
@TEST-END-FILE @TEST-END-FILE