Database: Fixed bug that mis-compared data file names

This commit is contained in:
Paul Beckingham 2016-04-22 21:54:16 -04:00
parent e1bac52c68
commit 35f54b64e1

View file

@ -185,10 +185,11 @@ unsigned int Database::getDatafile (int year, int month)
<< std::setw (2) << std::setfill ('0') << month
<< ".data";
auto name = file.str ();
auto basename = File (name).name ();
// If the datafile is already initialized, return.
for (unsigned int i = 0; i < _files.size (); ++i)
if (_files[i].name () == name)
if (_files[i].name () == basename)
return i;
// Create the Datafile. New files need the set of current exclusions.