Config returns code unit count for strings - didn't always.

This commit is contained in:
Philip.Hazel 2014-11-11 10:50:31 +00:00
parent bcf59568aa
commit bb34dede56
2 changed files with 8 additions and 11 deletions

View File

@ -129,9 +129,8 @@ switch (what)
#ifdef SUPPORT_JIT
{
const char *v = PRIV(jit_get_target)();
return (where == NULL)?
(int)((strlen(v) + 1) * sizeof(PCRE2_UCHAR)) :
PRIV(strcpy_c8)((PCRE2_UCHAR *)where, v) + 1;
return 1 + ((where == NULL)?
(int)strlen(v) : PRIV(strcpy_c8)((PCRE2_UCHAR *)where, v));
}
#else
return PCRE2_ERROR_BADOPTION;
@ -172,10 +171,9 @@ switch (what)
#else
const char *v = "Unicode not supported";
#endif
return (where == NULL)?
(int)((strlen(v) + 1) * sizeof(PCRE2_UCHAR)) :
PRIV(strcpy_c8)((PCRE2_UCHAR *)where, v) + 1;
}
return 1 + ((where == NULL)?
(int)strlen(v): PRIV(strcpy_c8)((PCRE2_UCHAR *)where, v));
}
break;
case PCRE2_CONFIG_UNICODE:
@ -210,9 +208,8 @@ switch (what)
const char *v = (XSTRING(Z PCRE2_PRERELEASE)[1] == 0)?
XSTRING(PCRE2_MAJOR.PCRE2_MINOR PCRE2_DATE) :
XSTRING(PCRE2_MAJOR.PCRE2_MINOR) XSTRING(PCRE2_PRERELEASE PCRE2_DATE);
return (where == NULL)?
(int)((strlen(v) + 1) * sizeof(PCRE2_UCHAR)) :
PRIV(strcpy_c8)((PCRE2_UCHAR *)where, v) + 1;
return 1 + ((where == NULL)?
(int)strlen(v) : PRIV(strcpy_c8)((PCRE2_UCHAR *)where, v));
}
}

View File

@ -5768,7 +5768,7 @@ if (rc != 0)
print_unicode_version(stdout);
printf(")\n");
}
else printf(" No UTF or UCP support\n");
else printf(" No Unicode support\n");
(void)PCRE2_CONFIG(PCRE2_CONFIG_JIT, &rc);
if (rc != 0)