diff --git a/src/ls.c b/src/ls.c index 7dbcfa75d08d..3b9f5ac4325c 100644 --- a/src/ls.c +++ b/src/ls.c @@ -4423,20 +4423,24 @@ print_long_format (const struct fileinfo *f) } dired_outbuf (buf, p - buf); - size_t w = print_name_with_quoting (f, false, &dired_obstack, p - buf); if (f->filetype == symbolic_link) { + size_t w = print_name_with_quoting (f, true, &dired_obstack, p - buf); if (f->linkname) { - dired_outstring (" -> "); - print_name_with_quoting (f, true, NULL, (p - buf) + w + 4); + dired_outstring (" <- "); + print_name_with_quoting (f, false, NULL, (p - buf) + w + 4); if (indicator_style != none) print_type_indicator (true, f->linkmode, unknown); } } - else if (indicator_style != none) - print_type_indicator (f->stat_ok, f->stat.st_mode, f->filetype); + else + { + print_name_with_quoting (f, false, NULL, p - buf); + if (indicator_style != none) + print_type_indicator (f->stat_ok, f->stat.st_mode, f->filetype); + } } /* Write to *BUF a quoted representation of the file name NAME, if non-null,