diff options
author | Jim Meyering <jim@meyering.net> | 1996-11-02 15:28:08 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1996-11-02 15:28:08 +0000 |
commit | 1a5804607112941c4466cc1eb14082048a95efa4 (patch) | |
tree | 064b937188f1240a6d64b97b03df40556212c3c6 | |
parent | b3b3cf98c6acddf13530e790d635fcc98e3d0746 (diff) | |
download | coreutils-1a5804607112941c4466cc1eb14082048a95efa4.tar.xz |
(gobble_file): Set linkok for non-orphaned symlinks.
From Bauke Jan Douma.
(gobble_file): Initialize linkok.
With these two changes, ls --color should display orphaned symlinks
as blinking text on terminals that support it.
-rw-r--r-- | src/ls.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -112,7 +112,7 @@ struct fileinfo unsigned int linkmode; /* For symbolic link and color printing, 1 if linked-to file - exits, otherwise 0. */ + exists, otherwise 0. */ int linkok; enum filetype filetype; @@ -1594,6 +1594,7 @@ gobble_file (const char *name, int explicit_arg, const char *dirname) files[files_index].linkname = 0; files[files_index].linkmode = 0; + files[files_index].linkok = 0; if (explicit_arg || format_needs_stat) { @@ -1659,9 +1660,12 @@ gobble_file (const char *name, int explicit_arg, const char *dirname) files[files_index].stat = linkstats; } else - /* Get the linked-to file's mode for the filetype indicator - in long listings. */ - files[files_index].linkmode = linkstats.st_mode; + { + /* Get the linked-to file's mode for the filetype indicator + in long listings. */ + files[files_index].linkmode = linkstats.st_mode; + files[files_index].linkok = 1; + } } if (linkpath) free (linkpath); |