From: Jim Meyering Date: Thu, 30 May 1996 02:32:03 +0000 (+0000) Subject: (docolon): Give a warning when the first character X-Git-Tag: TEXTUTILS-1_15~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1d4b41340fe26293c6a62ba45e3950fef64e4c2;p=thirdparty%2Fcoreutils.git (docolon): Give a warning when the first character of the basic regular expression is `^'. --- diff --git a/src/expr.c b/src/expr.c index 567633b58a..bf5d1e4420 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));