]> git.sur5r.net Git - u-boot/commitdiff
test/py: fix off-by-one error in spawn matching code
authorStephen Warren <swarren@nvidia.com>
Sat, 6 Feb 2016 01:04:42 +0000 (18:04 -0700)
committerSimon Glass <sjg@chromium.org>
Tue, 9 Feb 2016 22:41:19 +0000 (15:41 -0700)
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: Stephen Warren <swarren@nvidia.com>
test/py/u_boot_spawn.py

index 4b9e81af3efbdd8e2d96db58273f194906ef91e6..3d9cde5ee0d063dcbd98384ce04a58cf8e1483ee 100644 (file)
@@ -142,7 +142,7 @@ class Spawn(object):
                     earliest_pi = pi
                 if earliest_m:
                     pos = earliest_m.start()
-                    posafter = earliest_m.end() + 1
+                    posafter = earliest_m.end()
                     self.before = self.buf[:pos]
                     self.after = self.buf[pos:posafter]
                     self.buf = self.buf[posafter:]