"" is not a valid pathname, but is returned unchanged.
Behaviour on Windows
On Windows this will accept either \ or / as the path
separator, but dirname will return a path using /
(except if on a network share, when the leading \\ will be
preserved). Expect these only to be able to handle complete
paths, and not for example just a network share or a drive.
UTF-8-encoded path names not valid in the current locale can be used.