diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c index 2c61406..db2ce65 100644 --- a/src/pcre2_jit_compile.c +++ b/src/pcre2_jit_compile.c @@ -4202,9 +4202,6 @@ TMP2 is not used. Otherwise TMP2 must contain the start of the subject buffer, and it is destroyed. Does not modify STR_PTR for invalid character sequences. */ DEFINE_COMPILER; -SLJIT_UNUSED_ARG(backtracks); -SLJIT_UNUSED_ARG(must_be_valid); - #if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32 struct sljit_jump *jump; #endif @@ -4278,6 +4275,10 @@ if (common->invalid_utf && !must_be_valid) } #endif /* PCRE2_CODE_UNIT_WIDTH == [8|16|32] */ #endif /* SUPPORT_UNICODE */ + +SLJIT_UNUSED_ARG(backtracks); +SLJIT_UNUSED_ARG(must_be_valid); + OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); } @@ -14131,6 +14132,10 @@ PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION pcre2_jit_compile(pcre2_code *code, uint32_t options) { pcre2_real_code *re = (pcre2_real_code *)code; +#ifdef SUPPORT_JIT +executable_functions *functions; +static int executable_allocator_is_working = 0; +#endif if (code == NULL) return PCRE2_ERROR_NULL; @@ -14165,8 +14170,7 @@ actions are needed: */ #ifdef SUPPORT_JIT -executable_functions *functions = (executable_functions *)re->executable_jit; -static int executable_allocator_is_working = 0; +functions = (executable_functions *)re->executable_jit; #endif if ((options & PCRE2_JIT_INVALID_UTF) != 0) diff --git a/src/pcre2grep.c b/src/pcre2grep.c index feafce0..aa84ea7 100644 --- a/src/pcre2grep.c +++ b/src/pcre2grep.c @@ -3361,18 +3361,23 @@ if (isdirectory(pathname)) because that affects the output from pcre2grep. */ #ifdef HAVE_REALPATH + { char resolvedpath[PATH_MAX]; + BOOL isSame; + size_t rlen; if (realpath(childpath, resolvedpath) == NULL) continue; /* This path is invalid - we can skip processing this */ - BOOL isSame = strcmp(pathname, resolvedpath) == 0; + isSame = strcmp(pathname, resolvedpath) == 0; if (isSame) continue; /* We have a recursion */ - size_t rlen = strlen(resolvedpath); + rlen = strlen(resolvedpath); if (rlen++ < sizeof(resolvedpath) - 3) { + BOOL contained; strcat(resolvedpath, "/"); - BOOL contained = strncmp(pathname, resolvedpath, rlen) == 0; + contained = strncmp(pathname, resolvedpath, rlen) == 0; if (contained) continue; /* We have a recursion */ } + } #endif /* HAVE_REALPATH */ frc = grep_or_recurse(childpath, dir_recurse, FALSE);