summaryrefslogtreecommitdiff
path: root/lib/regex-quote.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2022-06-03 17:52:19 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2022-06-03 18:09:38 -0700
commit762bd0aa660b0c1c02597e0d2e5c5fbf9bab1b91 (patch)
tree3347e5cd0fd53109bd8ff5ae0a5c659a18de89e9 /lib/regex-quote.c
parent1ba2b66ea45f9bc43cdc0f6f93efa59157d2b2ba (diff)
downloadgnulib-762bd0aa660b0c1c02597e0d2e5c5fbf9bab1b91.tar.gz
regex-quote: \] -> ] in EREs and BREs
* build-aux/bootstrap: * build-aux/bootstrap.conf (gettext_external): * check-AC_LIBOBJ: * lib/regex-quote.c (bre_special, ere_special): * gnulib-tool (func_modules_transitive_closure) (func_emit_autoconf_snippet, func_import, func_create_testdir): * tests/test-regex-quote.c (test_bre, test_ere): * top/maint.mk (longopt_re, gpg_key_ID): Don’t use \] in BREs and EREs, as POSIX says the interpretation is undefined.
Diffstat (limited to 'lib/regex-quote.c')
-rw-r--r--lib/regex-quote.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/regex-quote.c b/lib/regex-quote.c
index 24beb2508d..9b92e98910 100644
--- a/lib/regex-quote.c
+++ b/lib/regex-quote.c
@@ -26,10 +26,10 @@
#include "xalloc.h"
/* Characters that are special in a BRE. */
-static const char bre_special[] = "$^.*[]\\";
+static const char bre_special[] = "$^.*[\\";
/* Characters that are special in an ERE. */
-static const char ere_special[] = "$^.*[]\\+?{}()|";
+static const char ere_special[] = "$^.*[\\+?{}()|";
struct regex_quote_spec
regex_quote_spec_posix (int cflags, bool anchored)