* src/copy.c (copy_internal): Use the lint protected src_mode,
rather than accessing the src_sb again. Also unconditionally
populate src_sb when !x->move_mode and in lint mode.
Reported by Kamil Dudka with coverity and clang analyzer.
return false;
}
}
+#ifdef lint
+ else
+ {
+ assert (x->move_mode);
+ memset (&src_sb, 0, sizeof src_sb);
+ }
+#endif
/* Detect the case in which the same source file appears more than
once on the command line and no backup option has been selected.
This check is enabled only if x->src_info is non-NULL. */
if (command_line_arg && x->src_info)
{
- if ( ! S_ISDIR (src_sb.st_mode)
+ if ( ! S_ISDIR (src_mode)
&& x->backup_type == no_backups
&& seen_file (x->src_info, src_name, &src_sb))
{