Skip to content

Commit 8f310f6

Browse files
committed
get_permissions(): handle Windows that doesn't define Group
1 parent 6791367 commit 8f310f6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

+stdlib/get_permissions.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@
2222
if v.UserExecute
2323
p = replaceBetween(p, 3, 3, "x");
2424
end
25-
if v.GroupRead
25+
if ~isnan(v.GroupRead) && logical(v.GroupRead)
2626
p = replaceBetween(p, 4, 4, "r");
2727
end
28-
if v.GroupWrite
28+
if ~isnan(v.GroupWrite) && logical(v.GroupWrite)
2929
p = replaceBetween(p, 5, 5, "w");
3030
end
31-
if v.GroupExecute
31+
if ~isnan(v.GroupExecute) && logical(v.GroupExecute)
3232
p = replaceBetween(p, 6, 6, "x");
3333
end
34-
if v.OtherRead
34+
if ~isnan(v.OtherRead) && logical(v.OtherRead)
3535
p = replaceBetween(p, 7, 7, "r");
3636
end
37-
if v.OtherWrite
37+
if ~isnan(v.OtherWrite) && logical(v.OtherWrite)
3838
p = replaceBetween(p, 8, 8, "w");
3939
end
40-
if v.OtherExecute
40+
if ~isnan(v.OtherExecute) && logical(v.OtherExecute)
4141
p = replaceBetween(p, 9, 9, "x");
4242
end
4343

0 commit comments

Comments
 (0)