regposix.c - Oniguruma (regular expression library)\r
**********************************************************************/\r
/*-\r
- * Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>\r
+ * Copyright (c) 2002-2019 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>\r
* All rights reserved.\r
*\r
* Redistribution and use in source and binary forms, with or without\r
#define regex_t onig_regex_t\r
#include "regint.h"\r
#undef regex_t\r
+\r
#include "onigposix.h"\r
\r
#define ONIG_C(reg) ((onig_regex_t* )((reg)->onig))\r
OnigSyntaxType* syntax = OnigDefaultSyntax;\r
OnigOptionType options;\r
\r
+ reg->onig = (void* )0;\r
+\r
if ((posix_options & REG_EXTENDED) == 0)\r
syntax = ONIG_SYNTAX_POSIX_BASIC;\r
\r
\r
ENC_STRING_LEN(OnigEncDefaultCharEncoding, pattern, len);\r
r = onig_new(PONIG_C(reg), (UChar* )pattern, (UChar* )(pattern + len),\r
- options, OnigEncDefaultCharEncoding, syntax,\r
- (OnigErrorInfo* )NULL);\r
+ options, OnigEncDefaultCharEncoding, syntax,\r
+ (OnigErrorInfo* )NULL);\r
if (r != ONIG_NORMAL) {\r
return onig2posix_error_code(r);\r
}\r
\r
extern int\r
regexec(regex_t* reg, const char* str, size_t nmatch,\r
- regmatch_t pmatch[], int posix_options)\r
+ regmatch_t pmatch[], int posix_options)\r
{\r
int r, i, len;\r
UChar* end;\r
ENC_STRING_LEN(ONIG_C(reg)->enc, str, len);\r
end = (UChar* )(str + len);\r
r = onig_search(ONIG_C(reg), (UChar* )str, end, (UChar* )str, end,\r
- (OnigRegion* )pm, options);\r
+ (OnigRegion* )pm, options);\r
\r
if (r >= 0) {\r
r = 0; /* Match */\r
regfree(regex_t* reg)\r
{\r
onig_free(ONIG_C(reg));\r
+ reg->onig = (void* )0;\r
}\r
\r
\r
\r
static int\r
i_wrapper(const UChar* name, const UChar* name_end, int ng, int* gs,\r
- onig_regex_t* reg ARG_UNUSED, void* arg)\r
+ onig_regex_t* reg ARG_UNUSED, void* arg)\r
{\r
i_wrap* warg = (i_wrap* )arg;\r
\r