2 Commits
0.5.5 ... 0.5.6

Author SHA1 Message Date
Chris Done
c41fa86d17 Bump to 0.5.6 2016-03-04 15:07:00 +01:00
Chris Done
04608e0e53 Reject only .. and . (#13) 2016-03-04 15:06:27 +01:00
4 changed files with 9 additions and 4 deletions

View File

@@ -1,3 +1,5 @@
0.5.6:
* Reject only .. and .
0.5.5:
* Use filepath's isValid function for additional sanity checks
0.5.4:

View File

@@ -1,5 +1,5 @@
name: path
version: 0.5.5
version: 0.5.6
synopsis: Support for well-typed paths
description: Support for will-typed paths.
license: BSD3

View File

@@ -117,7 +117,7 @@ parseRelDir filepath =
not ("~/" `isPrefixOf` filepath) &&
not (hasParentDir filepath) &&
not (null (normalizeDir filepath)) &&
not (all (== '.') filepath) &&
filepath /= "." && filepath /= ".." &&
FilePath.isValid filepath
then return (Path (normalizeDir filepath))
else throwM (InvalidRelDir filepath)
@@ -134,7 +134,7 @@ parseAbsFile filepath =
not ("~/" `isPrefixOf` filepath) &&
not (hasParentDir filepath) &&
not (null (normalizeFile filepath)) &&
not (all (== '.') filepath) &&
filepath /= "." && filepath /= ".." &&
FilePath.isValid filepath
then return (Path (normalizeFile filepath))
else throwM (InvalidAbsFile filepath)
@@ -154,7 +154,7 @@ parseRelFile filepath =
not ("~/" `isPrefixOf` filepath) &&
not (hasParentDir filepath) &&
not (null (normalizeFile filepath)) &&
not (all (== '.') filepath) &&
filepath /= "." && filepath /= ".." &&
FilePath.isValid filepath
then return (Path (normalizeFile filepath))
else throwM (InvalidRelFile filepath)

View File

@@ -156,6 +156,7 @@ parseRelDirSpec =
failing "///foo//bar//mu/"
failing "///foo//bar////mu"
failing "///foo//bar/.//mu"
succeeding "..." (Path "...")
succeeding "foo.bak" (Path "foo.bak/")
succeeding "./foo" (Path "foo/")
succeeding "././foo" (Path "foo/")
@@ -176,6 +177,7 @@ parseAbsFileSpec =
failing "/"
failing "//"
failing "///foo//bar//mu/"
succeeding "..." (Path "...")
succeeding "/foo.txt" (Path "/foo.txt")
succeeding "///foo//bar////mu.txt" (Path "/foo/bar/mu.txt")
succeeding "///foo//bar/.//mu.txt" (Path "/foo/bar/mu.txt")
@@ -195,6 +197,7 @@ parseRelFileSpec =
failing "///foo//bar//mu/"
failing "///foo//bar////mu"
failing "///foo//bar/.//mu"
succeeding "..." (Path "...")
succeeding "foo.txt" (Path "foo.txt")
succeeding "./foo.txt" (Path "foo.txt")
succeeding "././foo.txt" (Path "foo.txt")