[Bug 274032] Regression after stable/12: grep: trailing backslash (\)

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 22 Sep 2023 19:28:42 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274032

            Bug ID: 274032
           Summary: Regression after stable/12: grep: trailing backslash
                    (\)
           Product: Base System
           Version: 13.2-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Keywords: regression
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: eugen@freebsd.org
                CC: kevans@freebsd.org

$ sh -E
$ unset LC_ALL
$ LANG=de_DE.ISO8859-1 grep $(builtin printf '\374') /dev/null
grep: trailing backslash (\)
$ LANG=ru_RU.KOI8-R grep $(builtin printf '\301') /dev/null
grep: trailing backslash (\)

\374 is "u" with an umlaut in 8-bit ISO8859-1 locale;
\301 is cyrillic "a" in 8-bit KOI8-R locale.

The problem does not manifest with 12.4 and earlier releases that have GNU
grep.
The error occurs not in bsdgrep code (used as grep in 13+) but comes from libc:
lib/libc/regex/regerror.c

-- 
You are receiving this mail because:
You are the assignee for the bug.