Author: brucem Date: Mon Aug 31 23:36:54 2015 New Revision: 246529 URL: http://llvm.org/viewvc/llvm-project?rev=246529&view=rev Log: [lldb-mi] Use find, not find_first_of, for "--".
Summary: find_first_of will look for any of the characters, not the full string passed in. When looking for "--" then, we must use find and not find_first_of. Reviewers: ki.stfu, abidh Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12517 Modified: lldb/trunk/tools/lldb-mi/MICmdArgValFile.cpp lldb/trunk/tools/lldb-mi/MICmdArgValOptionLong.cpp Modified: lldb/trunk/tools/lldb-mi/MICmdArgValFile.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdArgValFile.cpp?rev=246529&r1=246528&r2=246529&view=diff ============================================================================== --- lldb/trunk/tools/lldb-mi/MICmdArgValFile.cpp (original) +++ lldb/trunk/tools/lldb-mi/MICmdArgValFile.cpp Mon Aug 31 23:36:54 2015 @@ -146,7 +146,7 @@ CMICmdArgValFile::IsFilePath(const CMIUt const bool bHaveBckSlash = (vrFileNamePath.find_first_of("\\") != std::string::npos); // Look for --someLongOption - size_t nPos = vrFileNamePath.find_first_of("--"); + size_t nPos = vrFileNamePath.find("--"); const bool bLong = (nPos == 0); if (bLong) return false; Modified: lldb/trunk/tools/lldb-mi/MICmdArgValOptionLong.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdArgValOptionLong.cpp?rev=246529&r1=246528&r2=246529&view=diff ============================================================================== --- lldb/trunk/tools/lldb-mi/MICmdArgValOptionLong.cpp (original) +++ lldb/trunk/tools/lldb-mi/MICmdArgValOptionLong.cpp Mon Aug 31 23:36:54 2015 @@ -254,7 +254,7 @@ CMICmdArgValOptionLong::IsArgLongOption( if (bHavePosSlash || bHaveBckSlash) return false; - const size_t nPos = vrTxt.find_first_of("--"); + const size_t nPos = vrTxt.find("--"); if (nPos != 0) return false; _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits