summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ls.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/ls.c b/src/ls.c
index c1b19188c..1b0c250d7 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -4203,10 +4203,7 @@ print_color_indicator (const struct fileinfo *f, bool symlink_target)
type = C_STICKY;
}
else if (S_ISLNK (mode))
- type = ((!linkok
- && (color_symlink_as_referent
- || color_indicator[C_ORPHAN].string))
- ? C_ORPHAN : C_LINK);
+ type = C_LINK;
else if (S_ISFIFO (mode))
type = C_FIFO;
else if (S_ISSOCK (mode))
@@ -4241,6 +4238,14 @@ print_color_indicator (const struct fileinfo *f, bool symlink_target)
}
}
+ /* Adjust the color for orphaned symlinks. */
+ if (type == C_LINK && !linkok)
+ {
+ if (color_symlink_as_referent
+ || color_indicator[C_ORPHAN].string)
+ type = C_ORPHAN;
+ }
+
{
const struct bin_str *const s
= ext ? &(ext->seq) : &color_indicator[type];