Blame src/pcre2_context.c

Packit 504f36
/*************************************************
Packit 504f36
*      Perl-Compatible Regular Expressions       *
Packit 504f36
*************************************************/
Packit 504f36
Packit 504f36
/* PCRE is a library of functions to support regular expressions whose syntax
Packit 504f36
and semantics are as close as possible to those of the Perl 5 language.
Packit 504f36
Packit 504f36
                       Written by Philip Hazel
Packit 504f36
     Original API code Copyright (c) 1997-2012 University of Cambridge
Packit 504f36
          New API code Copyright (c) 2016-2017 University of Cambridge
Packit 504f36
Packit 504f36
-----------------------------------------------------------------------------
Packit 504f36
Redistribution and use in source and binary forms, with or without
Packit 504f36
modification, are permitted provided that the following conditions are met:
Packit 504f36
Packit 504f36
    * Redistributions of source code must retain the above copyright notice,
Packit 504f36
      this list of conditions and the following disclaimer.
Packit 504f36
Packit 504f36
    * Redistributions in binary form must reproduce the above copyright
Packit 504f36
      notice, this list of conditions and the following disclaimer in the
Packit 504f36
      documentation and/or other materials provided with the distribution.
Packit 504f36
Packit 504f36
    * Neither the name of the University of Cambridge nor the names of its
Packit 504f36
      contributors may be used to endorse or promote products derived from
Packit 504f36
      this software without specific prior written permission.
Packit 504f36
Packit 504f36
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Packit 504f36
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Packit 504f36
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Packit 504f36
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
Packit 504f36
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
Packit 504f36
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
Packit 504f36
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
Packit 504f36
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
Packit 504f36
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
Packit 504f36
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
Packit 504f36
POSSIBILITY OF SUCH DAMAGE.
Packit 504f36
-----------------------------------------------------------------------------
Packit 504f36
*/
Packit 504f36
Packit 504f36
Packit 504f36
#ifdef HAVE_CONFIG_H
Packit 504f36
#include "config.h"
Packit 504f36
#endif
Packit 504f36
Packit 504f36
#include "pcre2_internal.h"
Packit 504f36
Packit 504f36
Packit 504f36
Packit 504f36
/*************************************************
Packit 504f36
*          Default malloc/free functions         *
Packit 504f36
*************************************************/
Packit 504f36
Packit 504f36
/* Ignore the "user data" argument in each case. */
Packit 504f36
Packit 504f36
static void *default_malloc(size_t size, void *data)
Packit 504f36
{
Packit 504f36
(void)data;
Packit 504f36
return malloc(size);
Packit 504f36
}
Packit 504f36
Packit 504f36
Packit 504f36
static void default_free(void *block, void *data)
Packit 504f36
{
Packit 504f36
(void)data;
Packit 504f36
free(block);
Packit 504f36
}
Packit 504f36
Packit 504f36
Packit 504f36
Packit 504f36
/*************************************************
Packit 504f36
*        Get a block and save memory control     *
Packit 504f36
*************************************************/
Packit 504f36
Packit 504f36
/* This internal function is called to get a block of memory in which the
Packit 504f36
memory control data is to be stored at the start for future use.
Packit 504f36
Packit 504f36
Arguments:
Packit 504f36
  size        amount of memory required
Packit 504f36
  memctl      pointer to a memctl block or NULL
Packit 504f36
Packit 504f36
Returns:      pointer to memory or NULL on failure
Packit 504f36
*/
Packit 504f36
Packit 504f36
extern void *
Packit 504f36
PRIV(memctl_malloc)(size_t size, pcre2_memctl *memctl)
Packit 504f36
{
Packit 504f36
pcre2_memctl *newmemctl;
Packit 504f36
void *yield = (memctl == NULL)? malloc(size) :
Packit 504f36
  memctl->malloc(size, memctl->memory_data);
Packit 504f36
if (yield == NULL) return NULL;
Packit 504f36
newmemctl = (pcre2_memctl *)yield;
Packit 504f36
if (memctl == NULL)
Packit 504f36
  {
Packit 504f36
  newmemctl->malloc = default_malloc;
Packit 504f36
  newmemctl->free = default_free;
Packit 504f36
  newmemctl->memory_data = NULL;
Packit 504f36
  }
Packit 504f36
else *newmemctl = *memctl;
Packit 504f36
return yield;
Packit 504f36
}
Packit 504f36
Packit 504f36
Packit 504f36
Packit 504f36
/*************************************************
Packit 504f36
*          Create and initialize contexts        *
Packit 504f36
*************************************************/
Packit 504f36
Packit 504f36
/* Initializing for compile and match contexts is done in separate, private
Packit 504f36
functions so that these can be called from functions such as pcre2_compile()
Packit 504f36
when an external context is not supplied. The initializing functions have an
Packit 504f36
option to set up default memory management. */
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN pcre2_general_context * PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_general_context_create(void *(*private_malloc)(size_t, void *),
Packit 504f36
  void (*private_free)(void *, void *), void *memory_data)
Packit 504f36
{
Packit 504f36
pcre2_general_context *gcontext;
Packit 504f36
if (private_malloc == NULL) private_malloc = default_malloc;
Packit 504f36
if (private_free == NULL) private_free = default_free;
Packit 504f36
gcontext = private_malloc(sizeof(pcre2_real_general_context), memory_data);
Packit 504f36
if (gcontext == NULL) return NULL;
Packit 504f36
gcontext->memctl.malloc = private_malloc;
Packit 504f36
gcontext->memctl.free = private_free;
Packit 504f36
gcontext->memctl.memory_data = memory_data;
Packit 504f36
return gcontext;
Packit 504f36
}
Packit 504f36
Packit 504f36
Packit 504f36
/* A default compile context is set up to save having to initialize at run time
Packit 504f36
when no context is supplied to the compile function. */
Packit 504f36
Packit 504f36
const pcre2_compile_context PRIV(default_compile_context) = {
Packit 504f36
  { default_malloc, default_free, NULL },    /* Default memory handling */
Packit 504f36
  NULL,                                      /* Stack guard */
Packit 504f36
  NULL,                                      /* Stack guard data */
Packit 504f36
  PRIV(default_tables),                      /* Character tables */
Packit 504f36
  PCRE2_UNSET,                               /* Max pattern length */
Packit 504f36
  BSR_DEFAULT,                               /* Backslash R default */
Packit 504f36
  NEWLINE_DEFAULT,                           /* Newline convention */
Packit 504f36
  PARENS_NEST_LIMIT,                         /* As it says */
Packit 504f36
  0 };                                       /* Extra options */
Packit 504f36
Packit 504f36
/* The create function copies the default into the new memory, but must
Packit 504f36
override the default memory handling functions if a gcontext was provided. */
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN pcre2_compile_context * PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_compile_context_create(pcre2_general_context *gcontext)
Packit 504f36
{
Packit 504f36
pcre2_compile_context *ccontext = PRIV(memctl_malloc)(
Packit 504f36
  sizeof(pcre2_real_compile_context), (pcre2_memctl *)gcontext);
Packit 504f36
if (ccontext == NULL) return NULL;
Packit 504f36
*ccontext = PRIV(default_compile_context);
Packit 504f36
if (gcontext != NULL)
Packit 504f36
  *((pcre2_memctl *)ccontext) = *((pcre2_memctl *)gcontext);
Packit 504f36
return ccontext;
Packit 504f36
}
Packit 504f36
Packit 504f36
Packit 504f36
/* A default match context is set up to save having to initialize at run time
Packit 504f36
when no context is supplied to a match function. */
Packit 504f36
Packit 504f36
const pcre2_match_context PRIV(default_match_context) = {
Packit 504f36
  { default_malloc, default_free, NULL },
Packit 504f36
#ifdef SUPPORT_JIT
Packit 504f36
  NULL,
Packit 504f36
  NULL,
Packit 504f36
#endif
Packit 504f36
  NULL,
Packit 504f36
  NULL,
Packit 504f36
  PCRE2_UNSET,   /* Offset limit */
Packit 504f36
  HEAP_LIMIT,
Packit 504f36
  MATCH_LIMIT,
Packit 504f36
  MATCH_LIMIT_DEPTH };
Packit 504f36
Packit 504f36
/* The create function copies the default into the new memory, but must
Packit 504f36
override the default memory handling functions if a gcontext was provided. */
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN pcre2_match_context * PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_match_context_create(pcre2_general_context *gcontext)
Packit 504f36
{
Packit 504f36
pcre2_match_context *mcontext = PRIV(memctl_malloc)(
Packit 504f36
  sizeof(pcre2_real_match_context), (pcre2_memctl *)gcontext);
Packit 504f36
if (mcontext == NULL) return NULL;
Packit 504f36
*mcontext = PRIV(default_match_context);
Packit 504f36
if (gcontext != NULL)
Packit 504f36
  *((pcre2_memctl *)mcontext) = *((pcre2_memctl *)gcontext);
Packit 504f36
return mcontext;
Packit 504f36
}
Packit 504f36
Packit 504f36
Packit 504f36
/* A default convert context is set up to save having to initialize at run time
Packit 504f36
when no context is supplied to the convert function. */
Packit 504f36
Packit 504f36
const pcre2_convert_context PRIV(default_convert_context) = {
Packit 504f36
  { default_malloc, default_free, NULL },    /* Default memory handling */
Packit 504f36
#ifdef _WIN32
Packit 504f36
  CHAR_BACKSLASH,                            /* Default path separator */
Packit 504f36
  CHAR_GRAVE_ACCENT                          /* Default escape character */
Packit 504f36
#else  /* Not Windows */
Packit 504f36
  CHAR_SLASH,                                /* Default path separator */
Packit 504f36
  CHAR_BACKSLASH                             /* Default escape character */
Packit 504f36
#endif
Packit 504f36
  };
Packit 504f36
Packit 504f36
/* The create function copies the default into the new memory, but must
Packit 504f36
override the default memory handling functions if a gcontext was provided. */
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN pcre2_convert_context * PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_convert_context_create(pcre2_general_context *gcontext)
Packit 504f36
{
Packit 504f36
pcre2_convert_context *ccontext = PRIV(memctl_malloc)(
Packit 504f36
  sizeof(pcre2_real_convert_context), (pcre2_memctl *)gcontext);
Packit 504f36
if (ccontext == NULL) return NULL;
Packit 504f36
*ccontext = PRIV(default_convert_context);
Packit 504f36
if (gcontext != NULL)
Packit 504f36
  *((pcre2_memctl *)ccontext) = *((pcre2_memctl *)gcontext);
Packit 504f36
return ccontext;
Packit 504f36
}
Packit 504f36
Packit 504f36
Packit 504f36
/*************************************************
Packit 504f36
*              Context copy functions            *
Packit 504f36
*************************************************/
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN pcre2_general_context * PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_general_context_copy(pcre2_general_context *gcontext)
Packit 504f36
{
Packit 504f36
pcre2_general_context *new =
Packit 504f36
  gcontext->memctl.malloc(sizeof(pcre2_real_general_context),
Packit 504f36
  gcontext->memctl.memory_data);
Packit 504f36
if (new == NULL) return NULL;
Packit 504f36
memcpy(new, gcontext, sizeof(pcre2_real_general_context));
Packit 504f36
return new;
Packit 504f36
}
Packit 504f36
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN pcre2_compile_context * PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_compile_context_copy(pcre2_compile_context *ccontext)
Packit 504f36
{
Packit 504f36
pcre2_compile_context *new =
Packit 504f36
  ccontext->memctl.malloc(sizeof(pcre2_real_compile_context),
Packit 504f36
  ccontext->memctl.memory_data);
Packit 504f36
if (new == NULL) return NULL;
Packit 504f36
memcpy(new, ccontext, sizeof(pcre2_real_compile_context));
Packit 504f36
return new;
Packit 504f36
}
Packit 504f36
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN pcre2_match_context * PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_match_context_copy(pcre2_match_context *mcontext)
Packit 504f36
{
Packit 504f36
pcre2_match_context *new =
Packit 504f36
  mcontext->memctl.malloc(sizeof(pcre2_real_match_context),
Packit 504f36
  mcontext->memctl.memory_data);
Packit 504f36
if (new == NULL) return NULL;
Packit 504f36
memcpy(new, mcontext, sizeof(pcre2_real_match_context));
Packit 504f36
return new;
Packit 504f36
}
Packit 504f36
Packit 504f36
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN pcre2_convert_context * PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_convert_context_copy(pcre2_convert_context *ccontext)
Packit 504f36
{
Packit 504f36
pcre2_convert_context *new =
Packit 504f36
  ccontext->memctl.malloc(sizeof(pcre2_real_convert_context),
Packit 504f36
  ccontext->memctl.memory_data);
Packit 504f36
if (new == NULL) return NULL;
Packit 504f36
memcpy(new, ccontext, sizeof(pcre2_real_convert_context));
Packit 504f36
return new;
Packit 504f36
}
Packit 504f36
Packit 504f36
Packit 504f36
/*************************************************
Packit 504f36
*              Context free functions            *
Packit 504f36
*************************************************/
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_general_context_free(pcre2_general_context *gcontext)
Packit 504f36
{
Packit 504f36
if (gcontext != NULL)
Packit 504f36
  gcontext->memctl.free(gcontext, gcontext->memctl.memory_data);
Packit 504f36
}
Packit 504f36
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_compile_context_free(pcre2_compile_context *ccontext)
Packit 504f36
{
Packit 504f36
if (ccontext != NULL)
Packit 504f36
  ccontext->memctl.free(ccontext, ccontext->memctl.memory_data);
Packit 504f36
}
Packit 504f36
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_match_context_free(pcre2_match_context *mcontext)
Packit 504f36
{
Packit 504f36
if (mcontext != NULL)
Packit 504f36
  mcontext->memctl.free(mcontext, mcontext->memctl.memory_data);
Packit 504f36
}
Packit 504f36
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_convert_context_free(pcre2_convert_context *ccontext)
Packit 504f36
{
Packit 504f36
if (ccontext != NULL)
Packit 504f36
  ccontext->memctl.free(ccontext, ccontext->memctl.memory_data);
Packit 504f36
}
Packit 504f36
Packit 504f36
Packit 504f36
/*************************************************
Packit 504f36
*             Set values in contexts             *
Packit 504f36
*************************************************/
Packit 504f36
Packit 504f36
/* All these functions return 0 for success or PCRE2_ERROR_BADDATA if invalid
Packit 504f36
data is given. Only some of the functions are able to test the validity of the
Packit 504f36
data. */
Packit 504f36
Packit 504f36
Packit 504f36
/* ------------ Compile context ------------ */
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_set_character_tables(pcre2_compile_context *ccontext,
Packit 504f36
  const unsigned char *tables)
Packit 504f36
{
Packit 504f36
ccontext->tables = tables;
Packit 504f36
return 0;
Packit 504f36
}
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_set_bsr(pcre2_compile_context *ccontext, uint32_t value)
Packit 504f36
{
Packit 504f36
switch(value)
Packit 504f36
  {
Packit 504f36
  case PCRE2_BSR_ANYCRLF:
Packit 504f36
  case PCRE2_BSR_UNICODE:
Packit 504f36
  ccontext->bsr_convention = value;
Packit 504f36
  return 0;
Packit 504f36
Packit 504f36
  default:
Packit 504f36
  return PCRE2_ERROR_BADDATA;
Packit 504f36
  }
Packit 504f36
}
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_set_max_pattern_length(pcre2_compile_context *ccontext, PCRE2_SIZE length)
Packit 504f36
{
Packit 504f36
ccontext->max_pattern_length = length;
Packit 504f36
return 0;
Packit 504f36
}
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_set_newline(pcre2_compile_context *ccontext, uint32_t newline)
Packit 504f36
{
Packit 504f36
switch(newline)
Packit 504f36
  {
Packit 504f36
  case PCRE2_NEWLINE_CR:
Packit 504f36
  case PCRE2_NEWLINE_LF:
Packit 504f36
  case PCRE2_NEWLINE_CRLF:
Packit 504f36
  case PCRE2_NEWLINE_ANY:
Packit 504f36
  case PCRE2_NEWLINE_ANYCRLF:
Packit 504f36
  case PCRE2_NEWLINE_NUL:
Packit 504f36
  ccontext->newline_convention = newline;
Packit 504f36
  return 0;
Packit 504f36
Packit 504f36
  default:
Packit 504f36
  return PCRE2_ERROR_BADDATA;
Packit 504f36
  }
Packit 504f36
}
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_set_parens_nest_limit(pcre2_compile_context *ccontext, uint32_t limit)
Packit 504f36
{
Packit 504f36
ccontext->parens_nest_limit = limit;
Packit 504f36
return 0;
Packit 504f36
}
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_set_compile_extra_options(pcre2_compile_context *ccontext, uint32_t options)
Packit 504f36
{
Packit 504f36
ccontext->extra_options = options;
Packit 504f36
return 0;
Packit 504f36
}
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_set_compile_recursion_guard(pcre2_compile_context *ccontext,
Packit 504f36
  int (*guard)(uint32_t, void *), void *user_data)
Packit 504f36
{
Packit 504f36
ccontext->stack_guard = guard;
Packit 504f36
ccontext->stack_guard_data = user_data;
Packit 504f36
return 0;
Packit 504f36
}
Packit 504f36
Packit 504f36
Packit 504f36
/* ------------ Match context ------------ */
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_set_callout(pcre2_match_context *mcontext,
Packit 504f36
  int (*callout)(pcre2_callout_block *, void *), void *callout_data)
Packit 504f36
{
Packit 504f36
mcontext->callout = callout;
Packit 504f36
mcontext->callout_data = callout_data;
Packit 504f36
return 0;
Packit 504f36
}
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_set_heap_limit(pcre2_match_context *mcontext, uint32_t limit)
Packit 504f36
{
Packit 504f36
mcontext->heap_limit = limit;
Packit 504f36
return 0;
Packit 504f36
}
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_set_match_limit(pcre2_match_context *mcontext, uint32_t limit)
Packit 504f36
{
Packit 504f36
mcontext->match_limit = limit;
Packit 504f36
return 0;
Packit 504f36
}
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_set_depth_limit(pcre2_match_context *mcontext, uint32_t limit)
Packit 504f36
{
Packit 504f36
mcontext->depth_limit = limit;
Packit 504f36
return 0;
Packit 504f36
}
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_set_offset_limit(pcre2_match_context *mcontext, PCRE2_SIZE limit)
Packit 504f36
{
Packit 504f36
mcontext->offset_limit = limit;
Packit 504f36
return 0;
Packit 504f36
}
Packit 504f36
Packit 504f36
/* This function became obsolete at release 10.30. It is kept as a synonym for
Packit 504f36
backwards compatibility. */
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_set_recursion_limit(pcre2_match_context *mcontext, uint32_t limit)
Packit 504f36
{
Packit 504f36
return pcre2_set_depth_limit(mcontext, limit);
Packit 504f36
}
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_set_recursion_memory_management(pcre2_match_context *mcontext,
Packit 504f36
  void *(*mymalloc)(size_t, void *), void (*myfree)(void *, void *),
Packit 504f36
  void *mydata)
Packit 504f36
{
Packit 504f36
(void)mcontext;
Packit 504f36
(void)mymalloc;
Packit 504f36
(void)myfree;
Packit 504f36
(void)mydata;
Packit 504f36
return 0;
Packit 504f36
}
Packit 504f36
Packit 504f36
/* ------------ Convert context ------------ */
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_set_glob_separator(pcre2_convert_context *ccontext, uint32_t separator)
Packit 504f36
{
Packit 504f36
if (separator != CHAR_SLASH && separator != CHAR_BACKSLASH &&
Packit 504f36
    separator != CHAR_DOT) return PCRE2_ERROR_BADDATA;
Packit 504f36
ccontext->glob_separator = separator;
Packit 504f36
return 0;
Packit 504f36
}
Packit 504f36
Packit 504f36
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
Packit 504f36
pcre2_set_glob_escape(pcre2_convert_context *ccontext, uint32_t escape)
Packit 504f36
{
Packit 504f36
if (escape > 255 || (escape != 0 && !ispunct(escape)))
Packit 504f36
  return PCRE2_ERROR_BADDATA;
Packit 504f36
ccontext->glob_escape = escape;
Packit 504f36
return 0;
Packit 504f36
}
Packit 504f36
Packit 504f36
/* End of pcre2_context.c */
Packit 504f36