aboutsummaryrefslogtreecommitdiff
path: root/pcre.c
diff options
context:
space:
mode:
authorDmitry Mikhirev2015-03-06 21:55:42 +0300
committerDmitry Mikhirev2015-03-06 21:55:42 +0300
commite32303b41512e3386b83893b8331fb2d4f83be95 (patch)
tree7268e305930ab94661fec603362e1065b6fbc9e1 /pcre.c
parent68ff1e50c953ba421e8f266c4d9e2b690260c2c8 (diff)
downloadmake_pcre-e32303b41512e3386b83893b8331fb2d4f83be95.tar.gz
make_pcre-e32303b41512e3386b83893b8331fb2d4f83be95.tar.bz2
make_pcre-e32303b41512e3386b83893b8331fb2d4f83be95.tar.xz
make_pcre-e32303b41512e3386b83893b8331fb2d4f83be95.zip
added php-like `S' option
Diffstat (limited to 'pcre.c')
-rw-r--r--pcre.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/pcre.c b/pcre.c
index ccb5528..c6deef1 100644
--- a/pcre.c
+++ b/pcre.c
@@ -314,6 +314,7 @@ static char *match(const char *name, int argc, char **argv)
char *pat = NULL; /* expanded pattern */
char *p; /* iteration pointer */
int global = 0; /* global search? */
+ int study = 0; /* study pattern? */
int co = 0; /* pattern compilation options */
pcre *re = NULL; /* compiled regexp */
const char *err; /* compilation error */
@@ -335,6 +336,9 @@ static char *match(const char *name, int argc, char **argv)
case 'g': /* global search */
global = 1;
break;
+ case 'S': /* study pattern */
+ study = 1;
+ break;
default: /* not match-specific option */
co |= parse_comp_opt(*p, name);
break;
@@ -353,7 +357,7 @@ static char *match(const char *name, int argc, char **argv)
goto end_match;
}
- if (global) { /* study compiled pattern */
+ if (study) { /* study compiled pattern */
sd = pcre_study(re, 0, &err);
if (err) {
mk_warning("%s: %s", name, err);
@@ -436,6 +440,7 @@ static char *subst(const char *name, int argc, char **argv)
char *pat = NULL; /* expanded pattern */
char *p; /* iteration pointer */
int global = 0; /* global search? */
+ int study = 0; /* study pattern? */
int co = 0; /* pattern compilation options */
pcre *re = NULL; /* compiled regexp */
const char *err; /* compilation error */
@@ -462,6 +467,9 @@ static char *subst(const char *name, int argc, char **argv)
case 'g': /* global search */
global = 1;
break;
+ case 'S': /* study pattern */
+ study = 1;
+ break;
default: /* not subst-specific option */
co |= parse_comp_opt(*p, name);
break;
@@ -480,7 +488,7 @@ static char *subst(const char *name, int argc, char **argv)
goto end_subst;
}
- if (global) { /* study compiled pattern */
+ if (study) { /* study compiled pattern */
sd = pcre_study(re, 0, &err);
if (err) {
mk_warning("%s: %s", name, err);