From cc40beca462626a806518bb399cfa777c2fcef8f Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 17 Feb 2012 14:27:11 -0600 Subject: Fixes for variable shadowing (7/28) --- src/csv.cc | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/csv.cc') diff --git a/src/csv.cc b/src/csv.cc index f673033b..87f37ad1 100644 --- a/src/csv.cc +++ b/src/csv.cc @@ -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') -- cgit v1.2.3