]> granicus.if.org Git - onig/commitdiff
add calling onig_end() and reg_set_encoding()
authorkosako <kosako@sofnec.co.jp>
Wed, 6 Apr 2016 00:26:39 +0000 (09:26 +0900)
committerkosako <kosako@sofnec.co.jp>
Wed, 6 Apr 2016 00:26:39 +0000 (09:26 +0900)
sample/posix.c

index d24ee35b08954c17b0b44cdc478b7f0f3fa23510..f4cbe37a8fa4a5e9e7aee3a8d42eddc5b9ca1642 100644 (file)
@@ -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(&reg, (char* )pattern, REG_EXTENDED);
@@ -89,5 +91,6 @@ extern int main(int argc, char* argv[])
   x(&reg, pattern, (UChar* )"a\nb\n");
 
   regfree(&reg);
+  onig_end();
   return 0;
 }