summaryrefslogtreecommitdiffstats
path: root/parse.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-01-30 10:56:49 -0500
committerTavian Barnes <tavianator@tavianator.com>2022-01-30 10:56:49 -0500
commit9278a01d858d78a2e19e6da7388caa76bc1fc849 (patch)
tree633288f8bc1369050a55b4e380ea845a52f1087e /parse.c
parent18f77b8ee5d9c13f49a5c6c23db08d5a73a1d640 (diff)
downloadbfs-9278a01d858d78a2e19e6da7388caa76bc1fc849.tar.xz
parse: Add support for ed and sed regexes
They're apparently the same as POSIX basic regexes.
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/parse.c b/parse.c
index acab8d5..ce2ea21 100644
--- a/parse.c
+++ b/parse.c
@@ -2323,7 +2323,10 @@ static struct expr *parse_regextype(struct parser_state *state, int arg1, int ar
goto list_types;
}
- if (strcmp(type, "posix-basic") == 0) {
+ // See https://www.gnu.org/software/gnulib/manual/html_node/Predefined-Syntaxes.html
+ if (strcmp(type, "posix-basic") == 0
+ || strcmp(type, "ed") == 0
+ || strcmp(type, "sed") == 0) {
state->regex_flags = 0;
} else if (strcmp(type, "posix-extended") == 0) {
state->regex_flags = REG_EXTENDED;
@@ -2342,6 +2345,8 @@ list_types:
cfprintf(cfile, "Supported types are:\n\n");
cfprintf(cfile, " ${bld}posix-basic${rs}: POSIX basic regular expressions (BRE)\n");
cfprintf(cfile, " ${bld}posix-extended${rs}: POSIX extended regular expressions (ERE)\n");
+ cfprintf(cfile, " ${bld}ed${rs}: Like ${grn}ed${rs} (same as ${bld}posix-basic${rs})\n");
+ cfprintf(cfile, " ${bld}sed${rs}: Like ${grn}sed${rs} (same as ${bld}posix-basic${rs})\n");
return NULL;
}