[Lldb-commits] [PATCH] D12517: [lldb-mi] Use find, not find_first_of, for "--".

Bruce Mitchener via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 31 21:23:05 PDT 2015


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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12517.33662.patch
Type: text/x-patch
Size: 938 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150901/da4d7d3f/attachment-0001.bin>


More information about the lldb-commits mailing list