From patchwork Sat Feb 6 01:04:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 579713 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 656D5140556 for ; Sat, 6 Feb 2016 12:05:10 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E8436A7533; Sat, 6 Feb 2016 02:05:04 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xC7tLaStDTOY; Sat, 6 Feb 2016 02:05:04 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F14F1A753B; Sat, 6 Feb 2016 02:05:00 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C0C9CA74C3 for ; Sat, 6 Feb 2016 02:04:54 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bWJN3_v4fxF2 for ; Sat, 6 Feb 2016 02:04:54 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from avon.wwwdotorg.org (avon.wwwdotorg.org [70.85.31.133]) by theia.denx.de (Postfix) with ESMTPS id 55686A745C for ; Sat, 6 Feb 2016 02:04:50 +0100 (CET) Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id 415AA6492; Fri, 5 Feb 2016 18:04:31 -0700 (MST) Received: from swarren-lx1.nvidia.com (localhost [127.0.0.1]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id C04C7E461D; Fri, 5 Feb 2016 18:05:38 -0700 (MST) From: Stephen Warren To: Simon Glass Date: Fri, 5 Feb 2016 18:04:42 -0700 Message-Id: <1454720683-9557-1-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 2.7.0 X-NVConfidentiality: public X-Virus-Scanned: clamav-milter 0.98.6 at avon.wwwdotorg.org X-Virus-Status: Clean Cc: u-boot@lists.denx.de, Stephen Warren Subject: [U-Boot] [PATCH V2 1/2] test/py: fix off-by-one error in spawn matching code X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Stephen Warren 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 Acked-by: Simon Glass Tested-by: Simon Glass --- v2: New patch. --- test/py/u_boot_spawn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/py/u_boot_spawn.py b/test/py/u_boot_spawn.py index 4b9e81af3efb..3d9cde5ee0d0 100644 --- a/test/py/u_boot_spawn.py +++ b/test/py/u_boot_spawn.py @@ -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:]