diff --git a/tv_rename.cpp b/tv_rename.cpp index 16e2f47..4542464 100644 --- a/tv_rename.cpp +++ b/tv_rename.cpp @@ -123,7 +123,7 @@ void singleSeason( const std::string &path, const std::string &show, int season, auto name = compilePattern(pattern, season, num+1, og_name.substr(0, pos), episodes[num], show) + og_name.substr(pos); // replace characters illegal in windows if desired if( !linux ) { - season_code.erase(std::remove_if(name.begin(), name.end(), [](char x) {return x == '?' || x == '"' || x == '\\' || x == '|' || x == '*';}), season_code.end()); + name.erase(std::remove_if(name.begin(), name.end(), [](char x) {return x == '?' || x == '"' || x == '\\' || x == '|' || x == '*';}), name.end()); size_t max{name.size()}; for( size_t i = 0; i < max ; i++ ) { if( name[i] == '<' ) {