]> git.e2factory.org Git - e2factory.git/commit
Repair dirname and basename
authorTobias Ulmer <tu@emlix.com>
Wed, 9 Jan 2013 12:10:53 +0000 (13:10 +0100)
committerTobias Ulmer <tu@emlix.com>
Tue, 26 Feb 2013 18:07:13 +0000 (19:07 +0100)
commit50218a617b79f40482f12ef41e74bbefea002a17
tree7255c47f5c0ac398281399856d7b9ab98b8b3096
parent81e555537de11d90c2d2cb6b25b566f4b34239d2
Repair dirname and basename

basename and dirname must be able to handle paths ending in zero or more
slashes. Concatenation of dir- and basename will otherwise go wrong in
edge cases.

previously:
dirname(foo/bar/) -> foo/bar
basename(foo/bar/) -> bar
=> foo/bar/bar

now:
dirname(foo/bar///) -> foo
basename(foo/bar///) -> bar
=> foo/bar

Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/e2lib.lua