@@ -724,13 +724,13 @@ ly_pat_compile_posix(const char *pattern, void **pat_comp, struct ly_err_item **
724724static LY_ERR
725725ly_pat_compile_xmlschema_chblocks_xmlschema2perl (const char * pattern , char * * regex , struct ly_err_item * * err )
726726{
727- struct ublock_s {
728- char * ublock ;
729- char * urange ;
730- size_t size ;
731- };
727+ struct ublock_s {
728+ char * ublock ;
729+ char * urange ;
730+ size_t size ;
731+ };
732732 struct ublock_s ublock2urange [] = {
733- {"BasicLatin" , "[\\x{0000}-\\x{007F}]" ,19 },
733+ {"BasicLatin" , "[\\x{0000}-\\x{007F}]" , 19 },
734734 {"Latin-1Supplement" , "[\\x{0080}-\\x{00FF}]" , 19 },
735735 {"LatinExtended-A" , "[\\x{0100}-\\x{017F}]" , 19 },
736736 {"LatinExtended-B" , "[\\x{0180}-\\x{024F}]" , 19 },
@@ -833,7 +833,6 @@ struct ublock_s {
833833 }
834834 end = (ptr - perl_regex ) + 1 ;
835835
836-
837836 /* find our range */
838837 for (idx = 0 ; ublock2urange [idx ].ublock ; ++ idx ) {
839838 if (!strncmp (perl_regex + start + ly_strlen_const ("\\p{Is" ),
@@ -848,16 +847,16 @@ struct ublock_s {
848847 ublock = idx ;
849848
850849 /* need more space */
851- size_t urange_len = ublock2urange [ublock ].size ;
852- if (end - start < urange_len ) {
850+ size_t urange_len = ublock2urange [ublock ].size ;
851+
852+ if (end - start < urange_len ) {
853853 perl_regex = ly_realloc (perl_regex , strlen (perl_regex ) + (urange_len - (end - start )) + 1 );
854854 * regex = perl_regex ;
855855 if (!perl_regex ) {
856856 return ly_err_new (err , LY_EMEM , 0 , NULL , NULL , LY_EMEM_MSG );
857857 }
858858 }
859859
860-
861860 /* make the space in the string and replace the block (but we cannot include brackets if it was already enclosed in them) */
862861 for (idx2 = 0 , idx = 0 ; idx2 < start ; ++ idx2 ) {
863862 if ((perl_regex [idx2 ] == '[' ) && (!idx2 || (perl_regex [idx2 - 1 ] != '\\' ))) {
@@ -1119,6 +1118,7 @@ ly_pat_match_xmlschema(const void *pat_comp, const char *pattern, const char *st
11191118 int r , match_opts = 0 ;
11201119 pcre2_code * pcode = (void * )pat_comp ;
11211120 pcre2_match_data * match_data = NULL ;
1121+
11221122 if (!pat_comp ) {
11231123 /* compile pattern first */
11241124 rc = ly_pat_compile_xmlschema (pattern , (void * * )& pcode , err );
0 commit comments