Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable translation of maps into directory trees #2448

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Conform to project's formatting
  • Loading branch information
nikita-volkov committed Sep 20, 2022
commit 5c5d149c16286c5b5aaad7884c4a8f280197fbd3
8 changes: 4 additions & 4 deletions dhall/src/Dhall/DirectoryTree.hs
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ toDirectoryTree path expression = case expression of
-- Fail if path contains attempts to go to container directory,
-- which is a security risk.
if elem ".." keyPathSegments
then die
else return ()
then die
else return ()

(dirPath, fileName) <- case reverse keyPathSegments of
h : t ->
return
( Foldable.foldl' (</>) path (reverse t)
, h )
( Foldable.foldl' (</>) path (reverse t)
, h )
_ ->
die

Expand Down