Skip to content

builtin realpath --no-symlinks handles leading slashes incorrectly #8740

@mingcenwei

Description

@mingcenwei

builtin realpath --no-symlinks doesn't collapse leading slashes. (see tests/checks/realpath.fish)

$ sh -c 'env --unset=XDG_CONFIG_HOME HOME=$(mktemp -d) fish'

$ builtin realpath -s ///bin # Expected: `/bin`
///bin

$ builtin realpath -s //bin # Expected: `/bin`
//bin

Environment

$ fish --version
fish, version 3.3.1

$ echo $version
3.3.1

$ uname -a
Linux HOSTNAME 5.16.8-arch1-1 #1 SMP PREEMPT Tue, 08 Feb 2022 21:21:08 +0000 x86_64 GNU/Linux

$ echo $TERM
xterm-256color

Relevant files: src/builtins/realpath.cpp, src/wutil.cpp

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions