Commit 5b838296 authored by Wayne Davison's avatar Wayne Davison

A simple change to change_pathname() to ensure that the error output

mentions the right path when dir == NULL.
parent 8cd3c6dc
......@@ -366,19 +366,23 @@ int change_pathname(struct file_struct *file, const char *dir, int dirlen)
change_dir(orig_dir, CD_SKIP_CHDIR);
}
if (!change_dir(dir ? dir : orig_dir, CD_NORMAL)) {
pathname = dir;
pathname_len = dirlen;
if (!dir)
dir = orig_dir;
if (!change_dir(dir, CD_NORMAL)) {
chdir_error:
io_error |= IOERR_GENERAL;
rsyserr(FERROR, errno, "change_dir %s failed", full_fname(dir));
change_dir(orig_dir, CD_NORMAL);
if (dir != orig_dir)
change_dir(orig_dir, CD_NORMAL);
pathname = NULL;
pathname_len = 0;
return 0;
}
pathname = dir;
pathname_len = dirlen;
return 1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment