From patchwork Sun Feb 14 07:26:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduard - Gabriel Munteanu X-Patchwork-Id: 79259 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1E7RFus000753 for ; Sun, 14 Feb 2010 07:27:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752282Ab0BNH1N (ORCPT ); Sun, 14 Feb 2010 02:27:13 -0500 Received: from mail-bw0-f216.google.com ([209.85.218.216]:41035 "EHLO mail-bw0-f216.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752137Ab0BNH1M (ORCPT ); Sun, 14 Feb 2010 02:27:12 -0500 Received: by bwz8 with SMTP id 8so2012387bwz.38 for ; Sat, 13 Feb 2010 23:27:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:cc:subject :date:message-id:x-mailer; bh=G4yGVOqSWykkDpWHjYgnehMD5bXg2qomgpdP6lYr048=; b=ZrKl9erZRzLFerAzkFennKYUJNevoN42JhYLFgaYoGCMhjdAT7JnjrMyUArYWVkqtd ZavGEMx6BS15+WGUz0k5PdsGRREp61D359IeOuFBzZbXQEVdK4igw7fwAqbS0/9WDjtQ TWKNmGydZmNQQ7AncvWthuTbnGzT7Q9oZJPsA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer; b=mkvFT2/qF5Hu1aZy3pEhclRV/aZBqE6aeBw/oKqzlyCDRdOi5rmIW+jTP8TBLfkAfu ggB+0+GSkim9hjIlOA/bmxUbMHw0m2qocoelsZpyyBBpwPj/PuAWgH3nvt2it1VW7rdN s+uH/Pf2bImDzvKwYjiJRLTmpWBfphZLtd+Bc= Received: by 10.204.144.86 with SMTP id y22mr2285171bku.43.1266132429586; Sat, 13 Feb 2010 23:27:09 -0800 (PST) Received: from localhost.localdomain ([188.25.7.10]) by mx.google.com with ESMTPS id 13sm2177122bwz.14.2010.02.13.23.27.07 (version=SSLv3 cipher=RC4-MD5); Sat, 13 Feb 2010 23:27:08 -0800 (PST) From: Eduard - Gabriel Munteanu To: chris.mason@oracle.com Cc: linux-btrfs@vger.kernel.org, Eduard - Gabriel Munteanu Subject: [PATCH] bcp: fix off-by-one errors in path handling Date: Sun, 14 Feb 2010 09:26:55 +0200 Message-Id: <1266132415-17837-1-git-send-email-eduard.munteanu@linux360.ro> X-Mailer: git-send-email 1.6.4.4 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 14 Feb 2010 07:27:15 +0000 (UTC) diff --git a/bcp b/bcp index 5729e91..c6b4bef 100755 --- a/bcp +++ b/bcp @@ -137,7 +137,7 @@ for srci in xrange(0, src_args): statinfo = os.lstat(srcname) if srcname.startswith(src): - part = srcname[len(src) + 1:] + part = srcname[len(src):] if stat.S_ISLNK(statinfo.st_mode): copylink(srcname, dst, part, statinfo, None) @@ -153,7 +153,7 @@ for srci in xrange(0, src_args): for f in filenames: srcname = os.path.join(dirpath, f) if srcname.startswith(src): - part = srcname[len(src) + 1:] + part = srcname[len(src):] statinfo = os.lstat(srcname) copyfile(srcname, dst, part, statinfo, None)