From 3035c581282adb24ae1f63c5bc970cfa5c2292ce Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Fri, 6 Nov 2009 10:23:19 +0000 Subject: [PATCH] Accept any non-space characters in a header file (#3624) The FFI spec doesn't say exactly which characters may occur in a header file, so to be on the safe side we'll accept anything that isn't a space. --- compiler/parser/RdrHsSyn.lhs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/parser/RdrHsSyn.lhs b/compiler/parser/RdrHsSyn.lhs index c785c22..5b7269a 100644 --- a/compiler/parser/RdrHsSyn.lhs +++ b/compiler/parser/RdrHsSyn.lhs @@ -1012,7 +1012,9 @@ parseCImport cconv safety nm str = mk = CImport cconv safety - hdr_char c = isAscii c && (isAlphaNum c || c `elem` "._-") + hdr_char c = not (isSpace c) -- header files are filenames, which can contain + -- pretty much any char (depending on the platform), + -- so just accept any non-space character id_char c = isAlphaNum c || c == '_' cimp nm = (ReadP.char '&' >> skipSpaces >> CLabel <$> cid) -- 1.7.10.4