diff options
author | schwarze <> | 2016-05-26 13:33:53 +0000 |
---|---|---|
committer | schwarze <> | 2016-05-26 13:33:53 +0000 |
commit | d8989a72d4db82b1aec4821e7839cf23c17be8f7 (patch) | |
tree | 730c96b1cd6389a81af659bc3e590ee9eacca191 /src | |
parent | 8df09608f3f081cd55c0b4167a7b029f20b4c9a1 (diff) | |
download | openbsd-d8989a72d4db82b1aec4821e7839cf23c17be8f7.tar.gz openbsd-d8989a72d4db82b1aec4821e7839cf23c17be8f7.tar.bz2 openbsd-d8989a72d4db82b1aec4821e7839cf23c17be8f7.zip |
support for testing REG_STARTEND together with REG_NOTBOL
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libc/regex/main.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/regress/lib/libc/regex/main.c b/src/regress/lib/libc/regex/main.c index e0ed86f5e8..92257a7179 100644 --- a/src/regress/lib/libc/regex/main.c +++ b/src/regress/lib/libc/regex/main.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: main.c,v 1.7 2007/09/12 19:32:35 otto Exp $ */ | 1 | /* $OpenBSD: main.c,v 1.8 2016/05/26 13:33:53 schwarze Exp $ */ |
2 | /* $NetBSD: main.c,v 1.2 1995/04/20 22:39:51 cgd Exp $ */ | 2 | /* $NetBSD: main.c,v 1.2 1995/04/20 22:39:51 cgd Exp $ */ |
3 | 3 | ||
4 | #include <stdio.h> | 4 | #include <stdio.h> |
@@ -260,6 +260,9 @@ int opts; /* may not match f1 */ | |||
260 | fprintf(stderr, "%d: bad STARTEND syntax\n", line); | 260 | fprintf(stderr, "%d: bad STARTEND syntax\n", line); |
261 | subs[0].rm_so = strchr(f2, '(') - f2 + 1; | 261 | subs[0].rm_so = strchr(f2, '(') - f2 + 1; |
262 | subs[0].rm_eo = strchr(f2, ')') - f2; | 262 | subs[0].rm_eo = strchr(f2, ')') - f2; |
263 | /* the preceding character is relevant with REG_NOTBOL */ | ||
264 | f2copy[subs[0].rm_so - 1] = subs[0].rm_so > 1 ? | ||
265 | f2copy[subs[0].rm_so - 2] : 'X'; | ||
263 | } | 266 | } |
264 | err = regexec(&re, f2copy, NSUBS, subs, options('e', f1)); | 267 | err = regexec(&re, f2copy, NSUBS, subs, options('e', f1)); |
265 | 268 | ||