summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/regc_lex.c6
-rw-r--r--generic/regcomp.c2
-rw-r--r--generic/regex.h1
3 files changed, 8 insertions, 1 deletions
diff --git a/generic/regc_lex.c b/generic/regc_lex.c
index d07fe72..e20b222 100644
--- a/generic/regc_lex.c
+++ b/generic/regc_lex.c
@@ -283,6 +283,12 @@ struct vars *v;
/* remember flavor of last token */
v->lasttype = v->nexttype;
+ /* REG_BOSONLY */
+ if (v->nexttype == EMPTY && (v->cflags&REG_BOSONLY)) {
+ /* at start of a REG_BOSONLY RE */
+ RETV(SBEGIN, 0); /* same as \A */
+ }
+
/* if we're nested and we've hit end, return to outer level */
if (v->savenow != NULL && ATEOS()) {
v->now = v->savenow;
diff --git a/generic/regcomp.c b/generic/regcomp.c
index 26b937e..b292012 100644
--- a/generic/regcomp.c
+++ b/generic/regcomp.c
@@ -533,7 +533,7 @@ struct nfa *nfa;
/* add implicit .* in front */
rainbow(nfa, v->cm, PLAIN, COLORLESS, pre, pre);
- /* and ^* and \Z* too -- not always necessary, but harmless */
+ /* and ^* and \A* too -- not always necessary, but harmless */
newarc(nfa, PLAIN, nfa->bos[0], pre, pre);
newarc(nfa, PLAIN, nfa->bos[1], pre, pre);
}
diff --git a/generic/regex.h b/generic/regex.h
index 26be33c..0016005 100644
--- a/generic/regex.h
+++ b/generic/regex.h
@@ -223,6 +223,7 @@ typedef struct {
#define REG_NEWLINE 000300 /* newlines are line terminators */
#define REG_PEND 000400 /* ugh -- backward-compatibility hack */
#define REG_EXPECT 001000 /* report details on partial/limited matches */
+#define REG_BOSONLY 002000 /* temporary kludge for BOS-only matches */
#define REG_DUMP 004000 /* none of your business :-) */
#define REG_FAKEEC 010000 /* none of your business :-) */
#define REG_PROGRESS 020000 /* none of your business :-) */