+2007-10-07 Jim Meyering <meyering@redhat.com>
+
+ Avoid a used-uninitialized error.
+ * src/copy.c (copy_internal): Don't overload "use_stat".
+
2007-10-05 Jim Meyering <meyering@redhat.com>
Make a failing cross-partition mv give a sensible diagnostic.
bool delayed_ok;
bool copied_as_regular = false;
bool preserve_metadata;
- bool use_stat = true;
+ bool have_dst_lstat = false;
if (x->move_mode && rename_succeeded)
*rename_succeeded = false;
However, if we intend to unlink or remove the destination
first, use lstat, since a copy won't actually be made to the
destination in that case. */
- use_stat =
+ bool use_stat =
((S_ISREG (src_mode)
|| (x->copy_as_regular
&& ! (S_ISDIR (src_mode) || S_ISLNK (src_mode))))
bool return_now;
bool unlink_src;
+ have_dst_lstat = !use_stat;
if (! same_file_ok (src_name, &src_sb, dst_name, &dst_sb,
x, &return_now, &unlink_src))
{
/* If we called lstat above, good: use that data.
Otherwise, call lstat here, in case dst_name is a symlink. */
- if ( ! use_stat)
+ if (have_dst_lstat)
dst_lstat_sb = &dst_sb;
else
{