In the following function, my istringstream sets the fail bit the second time through the while loop on the line with the HERE comment. I've checked the contents of both command and ist, and they both seem to be right. Any ideas about what I'm doing wrong? Under what conditions can the HERE line fail?Code:int openFile(string filename) { // open file ifstream infile(filename.c_str()); if (!infile) { //handle error } string command; istringstream ist; //read in file contents while (!infile.eof()) { getline(infile,command); ist.str(command); ist >> command; //HERE ist.str(ist.str().substr(command.length()+1)); //really long if-statement } return 0; }