@@ -178,23 +178,23 @@ static void grep_set_pattern_type_option(enum grep_pattern_type pattern_type, st
178
178
179
179
case GREP_PATTERN_TYPE_BRE :
180
180
opt -> fixed = 0 ;
181
- opt -> pcre = 0 ;
181
+ opt -> pcre1 = 0 ;
182
182
break ;
183
183
184
184
case GREP_PATTERN_TYPE_ERE :
185
185
opt -> fixed = 0 ;
186
- opt -> pcre = 0 ;
186
+ opt -> pcre1 = 0 ;
187
187
opt -> regflags |= REG_EXTENDED ;
188
188
break ;
189
189
190
190
case GREP_PATTERN_TYPE_FIXED :
191
191
opt -> fixed = 1 ;
192
- opt -> pcre = 0 ;
192
+ opt -> pcre1 = 0 ;
193
193
break ;
194
194
195
195
case GREP_PATTERN_TYPE_PCRE :
196
196
opt -> fixed = 0 ;
197
- opt -> pcre = 1 ;
197
+ opt -> pcre1 = 1 ;
198
198
break ;
199
199
}
200
200
}
@@ -334,39 +334,39 @@ static int has_null(const char *s, size_t len)
334
334
}
335
335
336
336
#ifdef USE_LIBPCRE1
337
- static void compile_pcre_regexp (struct grep_pat * p , const struct grep_opt * opt )
337
+ static void compile_pcre1_regexp (struct grep_pat * p , const struct grep_opt * opt )
338
338
{
339
339
const char * error ;
340
340
int erroffset ;
341
341
int options = PCRE_MULTILINE ;
342
342
343
343
if (opt -> ignore_case ) {
344
344
if (has_non_ascii (p -> pattern ))
345
- p -> pcre_tables = pcre_maketables ();
345
+ p -> pcre1_tables = pcre_maketables ();
346
346
options |= PCRE_CASELESS ;
347
347
}
348
348
if (is_utf8_locale () && has_non_ascii (p -> pattern ))
349
349
options |= PCRE_UTF8 ;
350
350
351
- p -> pcre_regexp = pcre_compile (p -> pattern , options , & error , & erroffset ,
352
- p -> pcre_tables );
353
- if (!p -> pcre_regexp )
351
+ p -> pcre1_regexp = pcre_compile (p -> pattern , options , & error , & erroffset ,
352
+ p -> pcre1_tables );
353
+ if (!p -> pcre1_regexp )
354
354
compile_regexp_failed (p , error );
355
355
356
- p -> pcre_extra_info = pcre_study (p -> pcre_regexp , 0 , & error );
357
- if (!p -> pcre_extra_info && error )
356
+ p -> pcre1_extra_info = pcre_study (p -> pcre1_regexp , 0 , & error );
357
+ if (!p -> pcre1_extra_info && error )
358
358
die ("%s" , error );
359
359
}
360
360
361
- static int pcrematch (struct grep_pat * p , const char * line , const char * eol ,
361
+ static int pcre1match (struct grep_pat * p , const char * line , const char * eol ,
362
362
regmatch_t * match , int eflags )
363
363
{
364
364
int ovector [30 ], ret , flags = 0 ;
365
365
366
366
if (eflags & REG_NOTBOL )
367
367
flags |= PCRE_NOTBOL ;
368
368
369
- ret = pcre_exec (p -> pcre_regexp , p -> pcre_extra_info , line , eol - line ,
369
+ ret = pcre_exec (p -> pcre1_regexp , p -> pcre1_extra_info , line , eol - line ,
370
370
0 , flags , ovector , ARRAY_SIZE (ovector ));
371
371
if (ret < 0 && ret != PCRE_ERROR_NOMATCH )
372
372
die ("pcre_exec failed with error code %d" , ret );
@@ -379,25 +379,25 @@ static int pcrematch(struct grep_pat *p, const char *line, const char *eol,
379
379
return ret ;
380
380
}
381
381
382
- static void free_pcre_regexp (struct grep_pat * p )
382
+ static void free_pcre1_regexp (struct grep_pat * p )
383
383
{
384
- pcre_free (p -> pcre_regexp );
385
- pcre_free (p -> pcre_extra_info );
386
- pcre_free ((void * )p -> pcre_tables );
384
+ pcre_free (p -> pcre1_regexp );
385
+ pcre_free (p -> pcre1_extra_info );
386
+ pcre_free ((void * )p -> pcre1_tables );
387
387
}
388
388
#else /* !USE_LIBPCRE1 */
389
- static void compile_pcre_regexp (struct grep_pat * p , const struct grep_opt * opt )
389
+ static void compile_pcre1_regexp (struct grep_pat * p , const struct grep_opt * opt )
390
390
{
391
391
die ("cannot use Perl-compatible regexes when not compiled with USE_LIBPCRE" );
392
392
}
393
393
394
- static int pcrematch (struct grep_pat * p , const char * line , const char * eol ,
394
+ static int pcre1match (struct grep_pat * p , const char * line , const char * eol ,
395
395
regmatch_t * match , int eflags )
396
396
{
397
397
return 1 ;
398
398
}
399
399
400
- static void free_pcre_regexp (struct grep_pat * p )
400
+ static void free_pcre1_regexp (struct grep_pat * p )
401
401
{
402
402
}
403
403
#endif /* !USE_LIBPCRE1 */
@@ -479,8 +479,8 @@ static void compile_regexp(struct grep_pat *p, struct grep_opt *opt)
479
479
return ;
480
480
}
481
481
482
- if (opt -> pcre ) {
483
- compile_pcre_regexp (p , opt );
482
+ if (opt -> pcre1 ) {
483
+ compile_pcre1_regexp (p , opt );
484
484
return ;
485
485
}
486
486
@@ -836,8 +836,8 @@ void free_grep_patterns(struct grep_opt *opt)
836
836
case GREP_PATTERN_BODY :
837
837
if (p -> kws )
838
838
kwsfree (p -> kws );
839
- else if (p -> pcre_regexp )
840
- free_pcre_regexp (p );
839
+ else if (p -> pcre1_regexp )
840
+ free_pcre1_regexp (p );
841
841
else
842
842
regfree (& p -> regexp );
843
843
free (p -> pattern );
@@ -916,8 +916,8 @@ static int patmatch(struct grep_pat *p, char *line, char *eol,
916
916
917
917
if (p -> fixed )
918
918
hit = !fixmatch (p , line , eol , match );
919
- else if (p -> pcre_regexp )
920
- hit = !pcrematch (p , line , eol , match , eflags );
919
+ else if (p -> pcre1_regexp )
920
+ hit = !pcre1match (p , line , eol , match , eflags );
921
921
else
922
922
hit = !regexec_buf (& p -> regexp , line , eol - line , 1 , match ,
923
923
eflags );
0 commit comments