summaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1996-05-30 02:32:03 +0000
committerJim Meyering <jim@meyering.net>1996-05-30 02:32:03 +0000
commitf1d4b41340fe26293c6a62ba45e3950fef64e4c2 (patch)
tree759e5434665aee9d3db75a7d3dab30bd6d9e5f9c /src/expr.c
parentab8cec12c921595e6326ca105f0f231dc6dd4faf (diff)
downloadcoreutils-f1d4b41340fe26293c6a62ba45e3950fef64e4c2.tar.xz
(docolon): Give a warning when the first character
of the basic regular expression is `^'.
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/expr.c b/src/expr.c
index 567633b58..bf5d1e442 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -421,6 +421,14 @@ docolon (VALUE *sv, VALUE *pv)
tostring (sv);
tostring (pv);
+ if (pv->u.s[0] == '^')
+ {
+ error (0, 0, _("\
+warning: unportable BRE: `%s': using `^' as the first character \n\
+of the basic regular expression is not portable; it is being ignored"),
+ pv->u.s);
+ }
+
len = strlen (pv->u.s);
memset (&re_buffer, 0, sizeof (re_buffer));
memset (&re_regs, 0, sizeof (re_regs));