Eliminated unnecessary variable shadowing in write_logfile

This commit is contained in:
Ray Speth 2013-02-14 01:03:05 +00:00
parent d59cac4ca0
commit 1a0b59efd4

View file

@ -269,17 +269,10 @@ void Application::Messages::write_logfile(const std::string& file)
// can be appended to the name to create the name of a file
// that does not exist.
std::string fname = nm + ext;
std::ifstream f(fname.c_str());
if (f) {
int n = 0;
while (1 > 0) {
n++;
fname = nm + int2str(n) + ext;
std::ifstream f(fname.c_str());
if (!f) {
break;
}
}
int n = 0;
while (std::ifstream(fname.c_str())) {
n++;
fname = nm + int2str(n) + ext;
}
// Now we have a file name that does not correspond to any