diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2015-10-23 00:24:41 +0200 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2015-10-23 00:24:41 +0200 |
commit | 965dd233a23347d6fcdc7a582509470343f64c04 (patch) | |
tree | 599e4acdcecb8906c339ff005d709a192c2572f1 /lr.c | |
parent | 1ddb887fac3e7d36f09e094c722240414ccdd7f0 (diff) | |
download | lr-965dd233a23347d6fcdc7a582509470343f64c04.tar.gz lr-965dd233a23347d6fcdc7a582509470343f64c04.tar.xz lr-965dd233a23347d6fcdc7a582509470343f64c04.zip |
no unnecessary readlink calls
Diffstat (limited to 'lr.c')
-rw-r--r-- | lr.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lr.c b/lr.c index f6d3a94..91974e7 100644 --- a/lr.c +++ b/lr.c @@ -642,7 +642,10 @@ print(const void *nodep, const VISIT which, const int depth) case 'D': printf("%ld", fi->sb.st_dev); break; case 'i': printf("%ld", fi->sb.st_ino); break; case 'p': printf("%s", fi->fpath); break; - case 'l': printf("%s", readlin(fi->fpath, "")); break; + case 'l': + if (S_ISLNK(fi->sb.st_mode)) + printf("%s", readlin(fi->fpath, "")); + break; case 'n': printf("%*ld", intlen(maxlinks), fi->sb.st_nlink); break; case 'F': if (S_ISDIR(fi->sb.st_mode)) { |