aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Haberkorn <rhaberkorn@fmsbw.de>2026-06-27 12:16:37 +0200
committerRobin Haberkorn <rhaberkorn@fmsbw.de>2026-06-27 12:16:37 +0200
commite878ce9a44029d72c88d65cd0310b92ede2c28ad (patch)
tree1d212c3f61ef28ccdc6b0b4f633050a6467bd8c2
parentbda12e168733451328e39aceb6b2625f6b28e29c (diff)
downloadterex-e878ce9a44029d72c88d65cd0310b92ede2c28ad.tar.gz
REG_RAW is a pure re_comp() flag now
I missed the possibility to query the compilation flags from the execution variables.
-rw-r--r--README.md2
-rw-r--r--regex.h2
-rw-r--r--regexec.c6
-rwxr-xr-xregtest_terex.sh2
4 files changed, 6 insertions, 6 deletions
diff --git a/README.md b/README.md
index f3b39ab..dc5d19c 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ Compared to hsrex, this library has the following changes:
* Native UTF-8 support - no need to convert UTF-8 to UTF-32 first.
You no longer need to compile a special version of the library.
It expects Unicode strings by default unless specifying the `REG_RAW`
- compilation and execution flag.
+ compilation flag.
## TODO
diff --git a/regex.h b/regex.h
index c15d005..2a37ce6 100644
--- a/regex.h
+++ b/regex.h
@@ -230,7 +230,7 @@ typedef struct {
#define REG_DUMP 004000 /* none of your business :-) */
#define REG_FAKE 010000 /* none of your business :-) */
#define REG_PROGRESS 020000 /* none of your business :-) */
-#define REG_RAW 040000 /* pattern and subject are raw ASCII (also an execution flag) */
+#define REG_RAW 040000 /* pattern and subject are raw ASCII */
/*
* execution
diff --git a/regexec.c b/regexec.c
index e8131e2..d047929 100644
--- a/regexec.c
+++ b/regexec.c
@@ -158,7 +158,7 @@ static struct sset *pickss(struct vars *, struct dfa *, chr *, chr *);
static inline chr *
nextchr(struct vars *v, chr *s)
{
- if (v->eflags & REG_RAW) {
+ if (v->g->cflags & REG_RAW) {
return s+1;
}
@@ -180,7 +180,7 @@ nextchr(struct vars *v, chr *s)
static inline chr *
prevchr(struct vars *v, chr *s)
{
- if (v->eflags & REG_RAW) {
+ if (v->g->cflags & REG_RAW) {
return s-1;
}
@@ -194,7 +194,7 @@ prevchr(struct vars *v, chr *s)
static inline pchr
getchr(struct vars *v, const chr *s, const chr *end)
{
- if (v->eflags & REG_RAW) {
+ if (v->g->cflags & REG_RAW) {
return *s;
}
diff --git a/regtest_terex.sh b/regtest_terex.sh
index 29a88c5..75e051b 100755
--- a/regtest_terex.sh
+++ b/regtest_terex.sh
@@ -124,7 +124,7 @@ cat<<-EOF>$rgsrc
nmatch, cre.re_nsub);
return 1;
}
- rc = re_exec(&cre, dat, datlen, NULL, 100, pmatch, cflags & REG_RAW);
+ rc = re_exec(&cre, dat, datlen, NULL, 100, pmatch, 0);
if ( rc != REG_OKAY )
{
regerror(rc, &cre, buf, sizeof(buf));