Closed NiLuJe closed 2 months ago
There is thankfully no such madness happening with dirname
, so we once again have a guarantee that joining the output of dirname with the output of basename yields something sensible.
See https://github.com/koreader/koreader/pull/12038#issuecomment-2171805576 for more details, because I had completely forgotten we'd switched to (attempt to) prefer the GNU imp, because (ironically) Android...
Ah, OK xD You beat me to it, lol
because (ironically) Android...
Specifically, the only guarantee we have on bionic is that the public symbol will be named basename
. This happens to match the name of the GNU implementation on glibc, where the POSIX one is instead exported as __xpg_basename
....
Whether the Android implementation leans more towards a POSIX or GNU behavior is irrelevant (for the record, it leans towards a sane, POSIX behavior, while also not modifying its input ;p).
basename("/foo/") yielding "" is very much not what we signed up for...
This change is