Created
October 9, 2020 20:37
-
-
Save phadej/51864edda9e25452453990aa65d040b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Cabal/src/Distribution/FieldGrammar/Newtypes.hs b/Cabal/src/Distribution/FieldGrammar/Newtypes.hs | |
index 3f37b43eb..35a1e781c 100644 | |
--- a/Cabal/src/Distribution/FieldGrammar/Newtypes.hs | |
+++ b/Cabal/src/Distribution/FieldGrammar/Newtypes.hs | |
@@ -250,7 +250,11 @@ newtype FilePathNT = FilePathNT { getFilePathNT :: String } | |
instance Newtype String FilePathNT | |
instance Parsec FilePathNT where | |
- parsec = pack <$> parsecToken | |
+ parsec = do | |
+ token <- parsecToken | |
+ if null token | |
+ then P.unexpected "empty FilePath" | |
+ else return (FilePathNT token) | |
instance Pretty FilePathNT where | |
pretty = showFilePath . unpack |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment