regex-pcre-builtin 0.95.1.2.8.43 → 0.95.1.3.8.43
raw patch · 3 files changed
+13/−2 lines, 3 files
Files
- ChangeLog.md +6/−0
- regex-pcre-builtin.cabal +1/−1
- src/Text/Regex/PCRE/Text.hs +6/−1
ChangeLog.md view
@@ -1,5 +1,11 @@ See also http://pvp.haskell.org/faq +## 0.95.1.3.8.43+- Version bump to reflect pcre version (8.43) and to have Hackage upgrade from 0.95.1.2.8.43 which does not include #15++## 0.95.1.1.8.44+- Fix: `asCString` for `Text` regexes doesn't check for null-termination, causing the compiled regex to be corrupted. (@kuribas)+ ## 0.95.1.0.8.43 - Update to `regex-0.94.0.0` API
regex-pcre-builtin.cabal view
@@ -1,5 +1,5 @@ Name: regex-pcre-builtin-Version: 0.95.1.2.8.43+Version: 0.95.1.3.8.43 Cabal-Version: >=1.10 stability: Seems to work, passes a few tests build-type: Simple
src/Text/Regex/PCRE/Text.hs view
@@ -50,6 +50,9 @@ ) where import Data.Array(Array,listArray)+import Data.Char(ord)+import Control.Monad.Fail (fail)+import Prelude hiding (fail) import qualified Data.ByteString as B import qualified Data.ByteString.Unsafe as B import qualified Data.Text as T@@ -154,7 +157,9 @@ {-# INLINE asCString #-} asCString :: T.Text -> (CString->IO a) -> IO a-asCString = B.unsafeUseAsCString . T.encodeUtf8+asCString t+ | T.null t || (ord (T.last t) /= 0) = B.useAsCString $ T.encodeUtf8 t+ | otherwise = B.unsafeUseAsCString $ T.encodeUtf8 t {-# INLINE asCStringLen #-} asCStringLen :: T.Text -> (CStringLen->IO a) -> IO a