From e9cb3eb6cee714865eff7a29e6c2101e545617c2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?=
Date: Thu, 10 Apr 2014 17:09:57 +0100 Subject: [PATCH] maint: avoid static analysis warnings in ln.c * src/ln.c (do_link): It's not obvious that record_file() is a noop in the symlink case (in that case dest_set is NULL and so ignored). So to make it obvious, and to avoid false positives seen in coverity, add the explicit condition here. --- src/ln.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ln.c b/src/ln.c index 67266997e4..42bccfce77 100644 --- a/src/ln.c +++ b/src/ln.c @@ -343,7 +343,8 @@ do_link (const char *source, const char *dest) { /* Right after creating a hard link, do this: (note dest name and source_stats, which are also the just-linked-destinations stats) */ - record_file (dest_set, dest, &source_stats); + if (! symbolic_link) + record_file (dest_set, dest, &source_stats); if (verbose) { -- 2.47.2