Fixes for variable shadowing (7/28)

This commit is contained in:
John Wiegley 2012-02-17 14:27:11 -06:00
parent cf4a665a0e
commit cc40beca46

View file

@ -40,27 +40,27 @@
namespace ledger {
string csv_reader::read_field(std::istream& in)
string csv_reader::read_field(std::istream& sin)
{
string field;
char c;
if (in.peek() == '"' || in.peek() == '|') {
in.get(c);
if (sin.peek() == '"' || sin.peek() == '|') {
sin.get(c);
char x;
while (in.good() && ! in.eof()) {
in.get(x);
while (sin.good() && ! sin.eof()) {
sin.get(x);
if (x == '\\') {
in.get(x);
sin.get(x);
}
else if (x == '"' && in.peek() == '"') {
in.get(x);
else if (x == '"' && sin.peek() == '"') {
sin.get(x);
}
else if (x == c) {
if (x == '|')
in.unget();
else if (in.peek() == ',')
in.get(c);
sin.unget();
else if (sin.peek() == ',')
sin.get(c);
break;
}
if (x != '\0')
@ -68,8 +68,8 @@ string csv_reader::read_field(std::istream& in)
}
}
else {
while (in.good() && ! in.eof()) {
in.get(c);
while (sin.good() && ! sin.eof()) {
sin.get(c);
if (c == ',')
break;
if (c != '\0')