Skip to content

Commit b678a50

Browse files
atpottsGabriella439
authored andcommitted
fix chmod bug (#337)
The implementation of chmod was calculating the new permissions, but then setting the permissions back to the old ones. This fixes this bug. Similarly, the value returned was the od value rather than the new one.
1 parent f20d4e0 commit b678a50

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Turtle/Prelude.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,9 +1253,9 @@ chmod modifyPermissions path = liftIO (do
12531253
let permissions' = fromSystemDirectoryPermissions permissions
12541254
let permissions'' = modifyPermissions permissions'
12551255
changed = permissions' /= permissions''
1256-
let permissions''' = toSystemDirectoryPermissions permissions'
1256+
let permissions''' = toSystemDirectoryPermissions permissions''
12571257
when changed (Directory.setPermissions path' permissions''')
1258-
return permissions' )
1258+
return permissions'' )
12591259

12601260
-- | Get a file or directory's user permissions
12611261
getmod :: MonadIO io => FilePath -> io Permissions

0 commit comments

Comments
 (0)