Date: Wed, 05 Jun 2019 13:41:03 -0700
From: Jefferson Carpenter <[email protected]>
Message-ID: <[email protected]>
| Not if basename starts with //
If it does it shouldn't be being appended to anything, as // at the
start of a pathname has (potentially anyway) a different interpretation
than // anywhere else. It certainly isn't correct to simply rempve all
the /'s - my version would have left a // in the middle of the path in
that case, at least indicating what had gone wrong.
Part of the difficulty here is that we'd need to know the source of the
basename and dirname and how they're intended to be interpreted in
different circumstances - it is not uncommon to prepend a dirname only if
the basename does not start with '/' - in which case Stephane's version
would have been fine as it was.
This itself is one reason why any kind of "one size fits all" solution
is unlikely to really be workable.
kre