From: kosako Date: Wed, 6 Apr 2016 00:26:39 +0000 (+0900) Subject: add calling onig_end() and reg_set_encoding() X-Git-Tag: v6.0.0^2~71 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e3c548ec752cb7d7207279f4321bcac8e7d85986;p=onig add calling onig_end() and reg_set_encoding() --- diff --git a/sample/posix.c b/sample/posix.c index d24ee35..f4cbe37 100644 --- a/sample/posix.c +++ b/sample/posix.c @@ -38,6 +38,8 @@ extern int main(int argc, char* argv[]) regex_t reg; UChar* pattern; + reg_set_encoding(REG_POSIX_ENCODING_ASCII); + /* default syntax (ONIG_SYNTAX_RUBY) */ pattern = (UChar* )"^a+b{2,7}[c-f]?$|uuu"; r = regcomp(®, (char* )pattern, REG_EXTENDED); @@ -89,5 +91,6 @@ extern int main(int argc, char* argv[]) x(®, pattern, (UChar* )"a\nb\n"); regfree(®); + onig_end(); return 0; }