Skip to content

Commit

Permalink
Fix OS X chmod -R with a-x+X
Browse files Browse the repository at this point in the history
  • Loading branch information
xaizek committed May 13, 2016
1 parent 63908cf commit f7b472d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/modes/dialogs/attr_dialog_nix.c
Expand Up @@ -431,9 +431,6 @@ set_perm_string(FileView *view, const int perms[13], const int origin_perms[13],
adv_perms[0] = -1;
adv_perms[1] = -1;
adv_perms[2] = -1;

perm_str_len += snprintf(perm_str + perm_str_len,
sizeof(perm_str) - perm_str_len, "a-x+X,");
}

for(i = 0; i < 12; i++)
Expand Down Expand Up @@ -468,6 +465,12 @@ set_perm_string(FileView *view, const int perms[13], const int origin_perms[13],
perm_str_len += snprintf(perm_str + perm_str_len,
sizeof(perm_str) - perm_str_len, "%s,", perm);
}

if(adv_perms[0] < 0)
{
perm_str_len += snprintf(perm_str + perm_str_len,
sizeof(perm_str) - perm_str_len, "a-x+X,");
}
perm_str[strlen(perm_str) - 1] = '\0'; /* Remove last comma (','). */

files_chmod(view, perm_str, perms[12]);
Expand Down

0 comments on commit f7b472d

Please sign in to comment.