[PATCH]Re: The first character disappears

Atila
2009-08-27T17:44:20Z

Should be rstrip instead of strip.

Atila

Signed-off-by: Atila <atila.alr@dpf.gov.br>
---
bcp | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bcp b/bcp
index 5729e91..7c6b351 100755
--- a/bcp
+++ b/bcp
@@ -107,7 +107,7 @@ if src_args > 1:
exit(1)

for srci in xrange(0, src_args):
- src = args[srci]
+ src = args[srci].rstrip('/')
if os.path.isfile(src):
statinfo = os.lstat(src)
force_name = None
@@ -136,7 +136,7 @@ for srci in xrange(0, src_args):
srcname = os.path.join(dirpath, x)
statinfo = os.lstat(srcname)

- if srcname.startswith(src):
+ if srcname.startswith(src + '/'):
part = srcname[len(src) + 1:]

if stat.S_ISLNK(statinfo.st_mode):
@@ -152,7 +152,7 @@ for srci in xrange(0, src_args):

for f in filenames:
srcname = os.path.join(dirpath, f)
- if srcname.startswith(src):
+ if srcname.startswith(src + '/'):
part = srcname[len(src) + 1:]

statinfo = os.lstat(srcname)
--
1.6.4

*