Mercurial > hgrepos > Python > apps > py-cutils
changeset 279:44e62e36cad4
treesum: when normalizing filenames also remove trailing "/."
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sat, 22 Feb 2025 18:27:10 +0100 |
| parents | 822cf3a1da22 |
| children | f3e0b479928c |
| files | cutils/util/__init__.py |
| diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/cutils/util/__init__.py Fri Feb 21 17:27:59 2025 +0100 +++ b/cutils/util/__init__.py Sat Feb 22 18:27:10 2025 +0100 @@ -279,6 +279,8 @@ # This also handles adjacent /./ cases while b"/./" in filename: filename = filename.replace(b"/./", b"/", 1) + while filename.endswith(b"/."): + filename = filename[:-2] else: filename = filename.replace(u"\\", u"/") if strip_dot_slashes: @@ -287,6 +289,8 @@ # This also handles adjacent /./ cases while u"/./" in filename: filename = filename.replace(u"/./", u"/", 1) + while filename.endswith(u"/."): + filename = filename[:-2] return filename
