From f1d4b41340fe26293c6a62ba45e3950fef64e4c2 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 30 May 1996 02:32:03 +0000 Subject: (docolon): Give a warning when the first character of the basic regular expression is `^'. --- src/expr.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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)); -- cgit v1.2.3-54-g00ecf