]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(docolon): Give a warning when the first character
authorJim Meyering <jim@meyering.net>
Thu, 30 May 1996 02:32:03 +0000 (02:32 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 30 May 1996 02:32:03 +0000 (02:32 +0000)
of the basic regular expression is `^'.

src/expr.c

index 567633b58ade0c5ed572c59eb52e6c39be759f0d..bf5d1e4420e0d5e788cfe14db460aa3df5301ad1 100644 (file)
@@ -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));