Commit 4e0fa131 authored by Wayne Davison's avatar Wayne Davison

Don't let --chmod tweak a 0 mode value (which marks a missing arg).

parent 17a16769
......@@ -794,7 +794,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
if (!(xflags & XMIT_SAME_MODE))
mode = from_wire_mode(read_int(f));
if (chmod_modes && !S_ISLNK(mode))
if (chmod_modes && !S_ISLNK(mode) && mode)
mode = tweak_mode(mode, chmod_modes);
if (preserve_uid && !(xflags & XMIT_SAME_UID)) {
......@@ -1372,7 +1372,7 @@ static struct file_struct *send_file_name(int f, struct file_list *flist,
if (!file)
return NULL;
if (chmod_modes && !S_ISLNK(file->mode))
if (chmod_modes && !S_ISLNK(file->mode) && file->mode)
file->mode = tweak_mode(file->mode, chmod_modes);
if (f >= 0) {
......
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