--- misc/mysql_splitter/splitter.cpp 2011/04/10 21:15:14 1283 +++ misc/mysql_splitter/splitter.cpp 2011/04/11 05:14:37 1284 @@ -35,20 +35,19 @@ return out.str(); } -string getLastWord(string input) { +string get_db_name(string input) { input = remove_comments(input); boost::erase_all(input,"`"); + boost::erase_all(input, ";"); boost::trim(input); + vector words; words = boost::split(words, input, boost::is_any_of(" ") ); string last = words.back(); - - boost::erase_all(last, ";"); boost::trim(last); - return last; } @@ -116,7 +115,7 @@ } boost::trim(line); - string dbname = getLastWord(line); + string dbname = get_db_name(line); cout << ">" << dbname << endl;