Skip to content

ls --dired reports wrong filename boundaries for symlinks #10248

@dcolascione

Description

@dcolascione

Description

ls --dired incorrectly reports filename boundaries that include the symlink target in the //DIRED// output. GNU coreutils correctly reports only the symlink name.

Reproduction

test_dir=$(mktemp -d)
ln -s "./bar/baz" "$test_dir/foo"
ls --dired -la "$test_dir"
rm -rf "$test_dir"

Expected (GNU coreutils 9.1)

  lrwxrwxrwx  1 user user     9 Jan 14 14:18 foo -> ./bar/baz
//DIRED// 60 61 111 113 163 166

The symlink entry 163 166 spans 3 characters = "foo" (correct).

Actual (uutils 0.2.2)

  lrwxrwxrwx  1 user user     9 Jan 14 14:18 foo -> ./bar/baz
//DIRED// 58 59 108 110 159 175

The symlink entry 159 175 spans 16 characters = "foo -> ./bar/baz" (incorrect - includes target).

Impact

This breaks Emacs dired mode. The dired-filename text property gets set to include the symlink target, causing dired-get-filename to return "foo -> ./bar/baz" instead of just "foo".

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions