Trailing '/' characters are not counted as part of the pathname.
Hence "/usr/" is the same as "/usr", which might denote a file or a directory with name (directory entry named) usr
in the directory /
. The function dirname
returns the parent directory of the path. The parent directory of /usr
is /
. Seems entirely consistent.