diff mbox

bcp: fix off-by-one errors in path handling

Message ID 1266132415-17837-1-git-send-email-eduard.munteanu@linux360.ro (mailing list archive)
State New, archived
Headers show

Commit Message

Eduard - Gabriel Munteanu Feb. 14, 2010, 7:26 a.m. UTC
None
diff mbox

Patch

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)