Fixed an error in the xml writer, that occurred when two newlines

appear next to each other.
This commit is contained in:
Harry Moffat 2009-03-17 15:12:16 +00:00
parent 291d51af83
commit c20cf5ebfd

View file

@ -1240,14 +1240,18 @@ namespace Cantera {
while (1 > 0) {
ieol = vv.find('\n');
if (ieol != string::npos) {
int jf = ieol - 1;
for (int j = 0; j < (int) ieol; j++) {
if (! isspace(vv[j])) {
jf = j;
break;
if (ieol == 0) {
s << endl << indent << " ";
} else {
int jf = ieol - 1;
for (int j = 0; j < (int) ieol; j++) {
if (! isspace(vv[j])) {
jf = j;
break;
}
}
s << endl << indent << " " << vv.substr(jf,ieol-jf);
}
s << endl << indent << " " << vv.substr(jf,ieol-jf);
vv = vv.substr(ieol+1);
}
else {