All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bcp: fix off-by-one errors in path handling
@ 2010-02-14  7:26 Eduard - Gabriel Munteanu
  0 siblings, 0 replies; only message in thread
From: Eduard - Gabriel Munteanu @ 2010-02-14  7:26 UTC (permalink / raw)
  To: chris.mason; +Cc: linux-btrfs, Eduard - Gabriel Munteanu

This fixes a bug which causes the first character of each filename in
the destination to be omitted.

Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
---
 bcp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

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)
-- 
1.6.4.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-02-14  7:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-14  7:26 [PATCH] bcp: fix off-by-one errors in path handling Eduard - Gabriel Munteanu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.