fix handline of sets only containing a zero-length string.

Thank you Robin...
This commit is contained in:
Bernhard Amann 2012-08-27 09:49:57 -07:00
parent 7e46936728
commit a4ca5b0d82
3 changed files with 8 additions and 3 deletions

View file

@ -345,9 +345,10 @@ Value* Ascii::EntryToVal(string s, FieldMapping field)
pos++; pos++;
} }
// test if the string ends with a set_separator... if it does we have to push an zero-lenght // test if the string ends with a set_separator... or if the complete string is
// val on top of it. // empty.
if ( *s.rbegin() == set_separator[0] ) // In either of these cases we have 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