From 2110ec6ed42fc306d5c25cbf970d013ff2a226fd Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 26 Aug 2013 20:59:40 -0700 Subject: [PATCH] dohtml: restore behavior noted in bug #425214 A trailing slash cause os.path.basename() and os.path.dirname() to behave differently, causing foo/ to behave similarly to the way that foo/* behaves. This behavior was broken by normalization in commit 3f67cb453ee1b74894c230459b43855db7fcc410. --- bin/dohtml.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/dohtml.py b/bin/dohtml.py index ec9a80b57..37d5b2ee2 100755 --- a/bin/dohtml.py +++ b/bin/dohtml.py @@ -206,7 +206,14 @@ def main(): success = False for x in args: + trailing_slash = x[-1:] == os.sep x = normalize_path(x) + if trailing_slash: + # Modify behavior of basename and dirname + # as noted in bug #425214, causing foo/ to + # behave similarly to the way that foo/* + # behaves. + x += os.sep basename = os.path.basename(x) dirname = os.path.dirname(x) success |= install(basename, dirname, options) -- 2.26.2