fix a FileCheck bug where:
[oota-llvm.git] / utils / FileCheck / FileCheck.cpp
index 8f48c3a0cf309131efbd99be7d76b77a9c5a07de..a6c1f74f6d6cfe5b650601a8a20b5732f402d422 100644 (file)
@@ -361,10 +361,10 @@ int main(int argc, char **argv) {
     }
     
 
-    // Otherwise, everything is good.  Remember this as the last match and move
-    // on to the next one.
-    LastMatch = Buffer.data();
+    // Otherwise, everything is good.  Step over the matched text and remember
+    // the position after the match as the end of the last match.
     Buffer = Buffer.substr(CheckStr.Str.size());
+    LastMatch = Buffer.data();
   }
   
   return 0;