Skip to content
Snippets Groups Projects
Commit d8926811 authored by Stephen Warren's avatar Stephen Warren Committed by Simon Glass
Browse files

test/py: fix off-by-one error in spawn matching code


A regex match object's .end() value is already the index after the match,
not the index of the last character in the match, so there's no need to
add 1 to point past the match.

Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
parent 83357fd5
No related branches found
No related tags found
No related merge requests found
...@@ -142,7 +142,7 @@ class Spawn(object): ...@@ -142,7 +142,7 @@ class Spawn(object):
earliest_pi = pi earliest_pi = pi
if earliest_m: if earliest_m:
pos = earliest_m.start() pos = earliest_m.start()
posafter = earliest_m.end() + 1 posafter = earliest_m.end()
self.before = self.buf[:pos] self.before = self.buf[:pos]
self.after = self.buf[pos:posafter] self.after = self.buf[pos:posafter]
self.buf = self.buf[posafter:] self.buf = self.buf[posafter:]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment