brucem created this revision. brucem added reviewers: ki.stfu, abidh. brucem added a subscriber: lldb-commits.
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. http://reviews.llvm.org/D12517 Files: tools/lldb-mi/MICmdArgValFile.cpp tools/lldb-mi/MICmdArgValOptionLong.cpp Index: tools/lldb-mi/MICmdArgValOptionLong.cpp =================================================================== --- tools/lldb-mi/MICmdArgValOptionLong.cpp +++ tools/lldb-mi/MICmdArgValOptionLong.cpp @@ -254,7 +254,7 @@ if (bHavePosSlash || bHaveBckSlash) return false; - const size_t nPos = vrTxt.find_first_of("--"); + const size_t nPos = vrTxt.find("--"); if (nPos != 0) return false; Index: tools/lldb-mi/MICmdArgValFile.cpp =================================================================== --- tools/lldb-mi/MICmdArgValFile.cpp +++ tools/lldb-mi/MICmdArgValFile.cpp @@ -146,7 +146,7 @@ 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;
Index: tools/lldb-mi/MICmdArgValOptionLong.cpp =================================================================== --- tools/lldb-mi/MICmdArgValOptionLong.cpp +++ tools/lldb-mi/MICmdArgValOptionLong.cpp @@ -254,7 +254,7 @@ if (bHavePosSlash || bHaveBckSlash) return false; - const size_t nPos = vrTxt.find_first_of("--"); + const size_t nPos = vrTxt.find("--"); if (nPos != 0) return false; Index: tools/lldb-mi/MICmdArgValFile.cpp =================================================================== --- tools/lldb-mi/MICmdArgValFile.cpp +++ tools/lldb-mi/MICmdArgValFile.cpp @@ -146,7 +146,7 @@ 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;
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits