diff options
Diffstat (limited to 'pomu/util/fs.py')
-rw-r--r-- | pomu/util/fs.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pomu/util/fs.py b/pomu/util/fs.py index 7016717..66716a7 100644 --- a/pomu/util/fs.py +++ b/pomu/util/fs.py @@ -5,6 +5,10 @@ import os def strip_prefix(string, prefix): """Returns a string, stripped from its prefix""" + if not prefix.endswith('/'): + aprefix = prefix + '/' + if string.startswith(aprefix): + return string[len(aprefix):] if string.startswith(prefix): return string[len(prefix):] else: |