diff --git a/extra/pcre/pcre-tests.factor b/extra/pcre/pcre-tests.factor index 96cd03cbe7..7ad2997f56 100644 --- a/extra/pcre/pcre-tests.factor +++ b/extra/pcre/pcre-tests.factor @@ -46,6 +46,11 @@ os unix? [ [ 10 ] [ PCRE_CONFIG_NEWLINE pcre-config ] unit-test ] when { 0 $ PCRE_CONFIG_UTF32 } member? ] unit-test +[ 33 ] +[ + [ "foo" f 33 pcre-fullinfo ] [ what>> ] recover +] unit-test + ! Tests for findall [ { { f "1999-01-12" } { "year" "1999" } { "month" "01" } { "day" "12" } } diff --git a/extra/pcre/pcre.factor b/extra/pcre/pcre.factor index 585ab4743e..25707a07aa 100644 --- a/extra/pcre/pcre.factor +++ b/extra/pcre/pcre.factor @@ -38,7 +38,8 @@ ERROR: pcre-error value ; rot 0 = [ drop ] [ bad-option ] if ; : pcre-fullinfo ( pcre extra what -- obj ) - { int } [ pcre_fullinfo ] with-out-parameters nip ; + [ { int } [ pcre_fullinfo ] with-out-parameters ] keep + rot 0 = [ drop ] [ bad-option ] if ; : pcre-substring-list ( subject match-array count -- alien ) { void* } [ pcre_get_substring_list drop ] with-out-parameters ;