diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2002-08-27 21:10:30 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2002-08-27 21:10:30 +0000 |
commit | 9634760d5eae4e8618e4b9ed9752d7305b3695a9 (patch) | |
tree | fc717bec9a623d6e80f2c4544cec14b8b8eb07da /Src/Modules/pcre.c | |
parent | 043c302261dfee52e54e9a6c42b4ebcc2f7ccd33 (diff) | |
download | zsh-9634760d5eae4e8618e4b9ed9752d7305b3695a9.tar.gz zsh-9634760d5eae4e8618e4b9ed9752d7305b3695a9.tar.xz zsh-9634760d5eae4e8618e4b9ed9752d7305b3695a9.zip |
17582: Improved option argument handling.
unposted: Updated version to 4.1.0-dev-6 because of interface change.
Diffstat (limited to 'Src/Modules/pcre.c')
-rw-r--r-- | Src/Modules/pcre.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Src/Modules/pcre.c b/Src/Modules/pcre.c index b6304ff01..36c437bc3 100644 --- a/Src/Modules/pcre.c +++ b/Src/Modules/pcre.c @@ -40,15 +40,15 @@ static pcre_extra *pcre_hints; /**/ static int -bin_pcre_compile(char *nam, char **args, char *ops, int func) +bin_pcre_compile(char *nam, char **args, Options ops, int func) { int pcre_opts = 0, pcre_errptr; const char *pcre_error; - if(ops['a']) pcre_opts |= PCRE_ANCHORED; - if(ops['i']) pcre_opts |= PCRE_CASELESS; - if(ops['m']) pcre_opts |= PCRE_MULTILINE; - if(ops['x']) pcre_opts |= PCRE_EXTENDED; + if(OPT_ISSET(ops,'a')) pcre_opts |= PCRE_ANCHORED; + if(OPT_ISSET(ops,'i')) pcre_opts |= PCRE_CASELESS; + if(OPT_ISSET(ops,'m')) pcre_opts |= PCRE_MULTILINE; + if(OPT_ISSET(ops,'x')) pcre_opts |= PCRE_EXTENDED; pcre_hints = NULL; /* Is this necessary? */ @@ -68,7 +68,7 @@ bin_pcre_compile(char *nam, char **args, char *ops, int func) /**/ static int -bin_pcre_study(char *nam, char **args, char *ops, int func) +bin_pcre_study(char *nam, char **args, Options ops, int func) { const char *pcre_error; @@ -92,12 +92,12 @@ bin_pcre_study(char *nam, char **args, char *ops, int func) /**/ static int -bin_pcre_match(char *nam, char **args, char *ops, int func) +bin_pcre_match(char *nam, char **args, Options ops, int func) { int ret, capcount, *ovec, ovecsize; char **captures, **matches, *receptacle = NULL; - if(ops['a']) { + if(OPT_ISSET(ops,'a')) { receptacle = *args++; if(!*args) { zwarnnam(nam, "not enough arguments", NULL, 0); |