Skip to content

File.join should handle "" separately #5905

@obskyr

Description

@obskyr

When using File.join with empty strings, some unexpected results can be seen:

File.join("", "file.cr")
File.join(["dir", "", "file.cr"])

These should evaluate to "file.cr" and "dir/file.cr" respectively, but instead they evaluate to "/file.cr" (whoops, absolute path out of nowhere) and "dir//file.cr".

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:bugA bug in the code. Does not apply to documentation, specs, etc.topic:stdlib

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions