Ticket #217: patch18.patch

File patch18.patch, 514 bytes (added by Charlie Hull, 17 years ago)

Clear the state of input() before reusing

  • harness/index_utils.cc

     
    170170    }
    171171    filename += *file++;
    172172    filename += ".txt";
     173   
     174    input.clear();
     175    input.open(filename.c_str());
    173176
    174     input.open(filename.c_str());
    175     if (!input) {
     177    if ((!input.is_open()) || input.fail()){
    176178        string msg = "Can't read file '";
    177179        msg += filename;
    178180        msg += "' for indexing (";