Skip to content

consistent result of basename for dir path #33000

@johnnychen94

Description

@johnnychen94

Although basename(path) is designed to split file name out from path, it doesn't check if the path is a valid file. That's to say, we can still use it to split folder name out from path as well.

Since there're two valid usages of dir path, it's expected to get the same results:

julia> basename("~/.ssh/")
"" # should be ".ssh"

julia> basename("~/.ssh")
".ssh"

This is tested on 1.0.4, 1.1.1, and 1.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions