Только в grep-3.11-alt1: ABOUT-NLS Только в grep-3.11-alt1: aclocal.m4 diff -ur grep-3.7-alt1/AUTHORS grep-3.11-alt1/AUTHORS --- grep-3.7-alt1/AUTHORS 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/AUTHORS 2023-01-02 07:36:23.000000000 +0300 @@ -1,4 +1,4 @@ - Copyright (C) 1992, 1997-2002, 2004-2022 Free Software Foundation, Inc. + Copyright (C) 1992, 1997-2002, 2004-2023 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright Только в grep-3.7-alt1: bootstrap Только в grep-3.7-alt1: bootstrap.conf Только в grep-3.11-alt1/build-aux: announce-gen Только в grep-3.11-alt1/build-aux: ar-lib Только в grep-3.11-alt1/build-aux: compile Только в grep-3.11-alt1/build-aux: config.guess Только в grep-3.11-alt1/build-aux: config.rpath Только в grep-3.11-alt1/build-aux: config.sub Только в grep-3.11-alt1/build-aux: depcomp Только в grep-3.11-alt1/build-aux: do-release-commit-and-tag Только в grep-3.11-alt1/build-aux: gendocs.sh Только в grep-3.7-alt1/build-aux: .gitignore Только в grep-3.7-alt1/build-aux: git-log-fix Только в grep-3.11-alt1/build-aux: gitlog-to-changelog Только в grep-3.11-alt1/build-aux: git-version-gen Только в grep-3.11-alt1/build-aux: gnupload Только в grep-3.11-alt1/build-aux: gnu-web-doc-update Только в grep-3.11-alt1/build-aux: install-sh Только в grep-3.11-alt1/build-aux: mdate-sh Только в grep-3.11-alt1/build-aux: missing Только в grep-3.11-alt1/build-aux: test-driver Только в grep-3.11-alt1/build-aux: texinfo.tex Только в grep-3.11-alt1/build-aux: update-copyright Только в grep-3.11-alt1/build-aux: useless-if-before-free Только в grep-3.11-alt1/build-aux: vc-list-files diff -ur grep-3.7-alt1/cfg.mk grep-3.11-alt1/cfg.mk --- grep-3.7-alt1/cfg.mk 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/cfg.mk 2023-03-23 05:55:27.000000000 +0300 @@ -1,5 +1,5 @@ # Customize maint.mk -*- makefile -*- -# Copyright (C) 2009-2022 Free Software Foundation, Inc. +# Copyright (C) 2009-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -31,7 +31,8 @@ # Tests not to run as part of "make distcheck". local-checks-to-skip = \ sc_indent \ - sc_texinfo_acronym + sc_texinfo_acronym \ + sc_unportable_grep_q # Tools used to bootstrap this package, used for "announcement". bootstrap-tools = autoconf,automake,gnulib @@ -67,7 +68,7 @@ # 1127556 9e export XZ_OPT = -6e -old_NEWS_hash = f4973b8b2470d613d782203aac8e8304 +old_NEWS_hash = acc0cb77b06cc80cd3d8811590cdd5f0 # We prefer to spell it back-reference, as POSIX does. sc_prohibit_backref: @@ -97,6 +98,7 @@ FILTER_LONG_LINES = \ /^[^:]*\.diff:[^:]*:@@ / d; \ \|^[^:]*TODO:| d; \ + \|^[^:]*doc/fdl.texi:| d; \ \|^[^:]*man/help2man:| d; \ \|^[^:]*tests/misc/sha[0-9]*sum.*\.pl[-:]| d; \ \|^[^:]*tests/pr/|{ \|^[^:]*tests/pr/pr-tests:| !d; }; @@ -178,5 +180,5 @@ | xargs grep -lw timeout \ | xargs grep -FLw require_timeout_ \ | $(GREP) . \ - && { echo '$(ME): timeout withtout use of require_timeout_' \ + && { echo '$(ME): timeout without use of require_timeout_' \ 1>&2; exit 1; } || : Только в grep-3.11-alt1: ChangeLog diff -ur grep-3.7-alt1/ChangeLog-2009 grep-3.11-alt1/ChangeLog-2009 --- grep-3.7-alt1/ChangeLog-2009 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/ChangeLog-2009 2023-05-10 23:10:36.000000000 +0300 @@ -1407,7 +1407,7 @@ is put in different compiled structure patterns[]. The patterns are given to dfacomp() and kwsmusts() as is. (Ecompile): Likewised. - (Fcompile): Reverse to the old behaviour of compiling the enire + (Fcompile): Reverse to the old behaviour of compiling the entire patterns in one shot. (EGexecute): If falling to GNU regex for the matching, loop in the array of compile patterns[] to find a match. @@ -1457,7 +1457,7 @@ (xrealloc): Removed using lib/xmalloc.c. (xmalloc): Removed using lib/xmalloc.c (main): Register with atexit() to check for error on stdout. - * configure.in: Check for atexit(), call jm_MALLOC, jm_RELLOC and + * configure.in: Check for atexit(), call jm_MALLOC, jm_REALLOC and jm_PREREQ_ERROR. * tests/bre.awk: Removed the hack to drain the buffer since we always fclose(stdout) atexit. @@ -1541,7 +1541,7 @@ * src/exclude.h: New file. * src/grep.c (main): Took the GNU tar code to handle the option --include, --exclude, --exclude-from. - Files are check for a match, with exlude_filename (). + Files are check for a match, with exclude_filename (). New option --exclude-from. * src/savedir.c: Call exclude_filename() to check for file pattern exclusion or inclusion. @@ -1592,7 +1592,7 @@ * m4/dosfile.m4 (AC_DOSFILE): Move AC_DEFINEs out of AC_CACHE_CHECK. -2001-02-17 Alain Malgoire +2001-02-17 Alain Magloire * doc/grep.texi: Document the new options and the new behaviour back-references are local. Use excerpt from Karl Berry regex @@ -1699,8 +1699,8 @@ (color): Rename color variable to color_option. Removed 'always|never|auto' arguments, not necessary for grep. (exclude_pattern): new variable, holder for the file pattern. - (include_pattern): new variable, hoder for the file pattern. - * src/savedir.c: Signature change, take two new argmuments. + (include_pattern): new variable, holder for the file pattern. + * src/savedir.c: Signature change, take two new arguments. * doc/grep.texi: Document, new options. * doc/grep.man: Document, new options. @@ -1712,7 +1712,7 @@ 2001-02-09 Alain Magloire - Patch from Ulrich Drepper to provide hilighting. + Patch from Ulrich Drepper to provide highlighting. * src/grep.c: New option --color. (color): New static var. @@ -1722,7 +1722,7 @@ to find the offset of the matching string. * src/savedir.c: Take advantage of _DIRENT_HAVE_TYPE if supported. * src/search.c (EGexecute, Fexecute, Pexecute): Take a new argument - when doing exact match for the color hiligting. + when doing exact match for the color highlighting. 2000-09-01 Brian Youmans @@ -1792,7 +1792,7 @@ 2000-06-02 Paul Eggert - Problen noted by Gerald Stoller + Problem noted by Gerald Stoller * src/grep.c (main): POSIX says that -q overrides -l, which in turn overrides the other output options. Fix grep to @@ -2208,7 +2208,7 @@ on pre-OpenVMS 7.x systems; general overhaul. * src/getpagesize.h: Reinstate support for different pagesizes on VAX and Alpha. Work around problem with DEC C compiler. - * src/vms_fab.c: Cast to some assigments; fixed typo argcp vs. argp. + * src/vms_fab.c: Cast to some assignments; fixed typo argcp vs. argp. * src/vms_fab.h: Added new include files to avoid warnings about undefined function prototypes. Those patches were provided by Martin P.J. Zinser (zinser@decus.de). @@ -2670,7 +2670,7 @@ 1999-03-16 Volker Borchert - * configure.in: Use case case ... esac for checking Visual C++. + * configure.in: Use case ... esac for checking Visual C++. When ${CC} contains options it was not recognize. 1999-03-07 Paul Eggert @@ -2764,7 +2764,7 @@ 1999-02-10 Alain Magloire - * bootstrap/{Makefile{try,am},REAMDE} : skeleton + * bootstrap/{Makefile{try,am},README} : skeleton provided for system lacking the tools to autoconfigure. * src/{e,f,}grepmat.c: added guard [HAVE_CONFIG_H] @@ -2858,7 +2858,7 @@ * doc/Makefile.am djgpp/Makefile.am m4/Makefile.am vms/Makefile.am: New files. - * m4/progtest.m4: proctect '[]' from m4. + * m4/progtest.m4: protect '[]' from m4. Noted by Eli Z. * PATCHES-AC: New file, add the patch for autoconf in the dist. @@ -3333,7 +3333,7 @@ Suggested by Harald Hanche-Olsen. * src/grep.c (main): '-f /dev/null' now specifies no patterns - and therfore matches nothing. + and therefore matches nothing. Reported by Jorge Stolfi. Patched by Paul Eggert. @@ -3368,7 +3368,7 @@ * src/grep.c: reverse back to greping directories, One could skip the error message by defining SKIP_DIR_ERROR. There is no clear way of doing - things, I hope to setle this on the next majore release + things, I hope to settle this on the next major release Thanks Paul Eggert, Eli Zaretskii and gnits for the exchange. @@ -3427,7 +3427,7 @@ (setmatcher) [HAVE_SETRLIMIT]: Set re_max_failures so that the matcher won't ever overflow the stack. (main) [__MSDOS__, _WIN32]: Handle backslashes and drive letters - in argv[0], remove the .exe suffix, and downcase the prgram name. + in argv[0], remove the .exe suffix, and downcase the program name. [O_BINARY]: Pass additional DOS-specific options to getopt_long and handle them. Call stat before attempting to open the file, in case it is a directory (DOS will fail the open call for @@ -3497,7 +3497,7 @@ regex package. Change the way the tests were done to be more conformant to automake. - * configure.in: added --disable-regex for folks with their own fuctions. + * configure.in: added --disable-regex for folks with their own functions. * grep-20d : available for testing @@ -3551,7 +3551,7 @@ * check.sh, scriptgen.awk: fix grep paths. - * change the directory strucure: grep is now in src to comply with + * change the directory structure: grep is now in src to comply with gettext.m4. * grep.c version.c [VERSION]: got rid of version.c, @@ -3648,6 +3648,6 @@ * Version 2.0 released. -Copyright (C) 1998-2022 Free Software Foundation, Inc. +Copyright (C) 1998-2023 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted provided the copyright notice and this notice are preserved. Только в grep-3.11-alt1: config.hin Только в grep-3.11-alt1: configure diff -ur grep-3.7-alt1/configure.ac grep-3.11-alt1/configure.ac --- grep-3.7-alt1/configure.ac 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/configure.ac 2023-04-10 08:22:42.000000000 +0300 @@ -1,7 +1,7 @@ dnl dnl autoconf input file for GNU grep dnl -dnl Copyright (C) 1997-2006, 2009-2022 Free Software Foundation, Inc. +dnl Copyright (C) 1997-2006, 2009-2023 Free Software Foundation, Inc. dnl dnl This file is part of GNU grep. dnl @@ -68,11 +68,7 @@ AC_DEFINE([GNULIB_NO_VLA], [1], [Define to 1 to disable use of VLAs]) # The test suite needs to know if we have a working perl. -# FIXME: this is suboptimal. Ideally, we would be able to call gl_PERL -# with an ACTION-IF-NOT-FOUND argument ... -cu_have_perl=yes -case $PERL in *"/missing "*) cu_have_perl=no;; esac -AM_CONDITIONAL([HAVE_PERL], [test $cu_have_perl = yes]) +AM_CONDITIONAL([HAVE_PERL], [test "$gl_cv_prog_perl" != no]) # gl_GCC_VERSION_IFELSE([major], [minor], [run-if-found], [run-if-not-found]) # ------------------------------------------------ @@ -142,6 +138,7 @@ gl_WARN_ADD([-Wno-sign-compare]) # Too many warnings for now gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now gl_WARN_ADD([-Wno-cast-function-type]) # sig-handler.h's sa_handler_t cast + gl_WARN_ADD([-Wno-deprecated-declarations]) # clang complains about sprintf # In spite of excluding -Wlogical-op above, it is enabled, as of # gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c @@ -215,6 +212,7 @@ AM_CONDITIONAL([USE_INCLUDED_REGEX], [test "$ac_use_included_regex" = yes]) if test "$ac_use_included_regex" = no; then AC_MSG_WARN([Included lib/regex.c not used]) + AC_DEFINE([USE_INCLUDED_REGEX], 1, [building with included regex code]) fi gl_FUNC_PCRE Только в grep-3.7-alt1/doc: egrep.man Только в grep-3.11-alt1/doc: fdl.texi Только в grep-3.7-alt1/doc: fgrep.man Только в grep-3.7-alt1/doc: .gitignore diff -ur grep-3.7-alt1/doc/grep.in.1 grep-3.11-alt1/doc/grep.in.1 --- grep-3.7-alt1/doc/grep.in.1 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/doc/grep.in.1 2023-04-29 11:38:31.000000000 +0300 @@ -244,6 +244,11 @@ .RB ( \-\^\-regexp ) option, search for all patterns given. The empty file contains zero patterns, and therefore matches nothing. +If +.IR FILE +is +.B \- +, read patterns from standard input. .TP .BR \-i ", " \-\^\-ignore\-case Ignore case distinctions in patterns and input data, @@ -279,10 +284,6 @@ .B ^ and .BR $ . -.TP -.B \-y -Obsolete synonym for -.BR \-i . .SS "General Output Control" .TP .BR \-c ", " \-\^\-count @@ -299,9 +300,6 @@ on the terminal. The colors are defined by the environment variable .BR GREP_COLORS . -The deprecated environment variable -.B GREP_COLOR -is still supported, but its setting does not have priority. .I WHEN is .BR never ", " always ", or " auto . @@ -321,6 +319,16 @@ Stop reading a file after .I NUM matching lines. +If +.I NUM +is zero, +.B grep +stops right away without reading input. +A +.I NUM +of \-1 is treated as infinity and +.B grep +does not stop; this is the default. If the input is standard input from a regular file, and .I NUM @@ -712,12 +720,12 @@ .BR \-U ", " \-\^\-binary Treat the file(s) as binary. By default, under MS-DOS and MS-Windows, -.BR grep +.B grep guesses whether a file is text or binary as described for the .B \-\^\-binary\-files option. If -.BR grep +.B grep decides the file is a text file, it strips the CR characters from the original file contents (to make regular expressions with .B ^ @@ -753,13 +761,14 @@ understands three different versions of regular expression syntax: \*(lqbasic\*(rq (BRE), \*(lqextended\*(rq (ERE) and \*(lqperl\*(rq (PCRE). In GNU -.B grep -there is no difference in available functionality between basic and -extended syntaxes. -In other implementations, basic regular expressions are less powerful. +.BR grep , +basic and extended regular expressions are merely different notations +for the same pattern-matching functionality. +In other implementations, basic regular expressions are ordinarily +less powerful than extended, though occasionally it is the other way around. The following description applies to extended regular expressions; differences for basic regular expressions are summarized afterwards. -Perl-compatible regular expressions give additional functionality, and are +Perl-compatible regular expressions have different functionality, and are documented in .BR pcre2syntax (3) and @@ -1003,34 +1012,10 @@ .B "locale \-a" lists locales that are currently available. .TP -.B GREP_COLOR -This variable specifies the color used to highlight matched (non-empty) text. -It is deprecated in favor of -.BR GREP_COLORS , -but still supported. -The -.BR mt , -.BR ms , -and -.B mc -capabilities of .B GREP_COLORS -have priority over it. -It can only specify the color used to highlight -the matching non-empty text in any matching line -(a selected line when the -.B \-v -command-line option is omitted, -or a context line when -.B \-v -is specified). -The default is -.BR 01;31 , -which means a bold red foreground text on the terminal's default background. -.TP -.B GREP_COLORS -Specifies the colors and other attributes -used to highlight various parts of the output. +Controls how the +.B \-\^\-color +option highlights output. Its value is a colon-separated list of capabilities that defaults to .B ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36 @@ -1264,38 +1249,13 @@ Also, POSIX requires that unrecognized options be diagnosed as \*(lqillegal\*(rq, but since they are not really against the law the default is to diagnose them as \*(lqinvalid\*(rq. -.B POSIXLY_CORRECT -also disables \fB_\fP\fIN\fP\fB_GNU_nonoption_argv_flags_\fP, -described below. -.TP -\fB_\fP\fIN\fP\fB_GNU_nonoption_argv_flags_\fP -(Here -.I N -is -.BR grep 's -numeric process ID.) If the -.IR i th -character of this environment variable's value is -.BR 1 , -do not consider the -.IR i th -operand of -.B grep -to be an option, even if it appears to be one. -A shell can put this variable in the environment for each command it runs, -specifying which operands are the results of file name wildcard -expansion and therefore should not be treated as options. -This behavior is available only with the GNU C library, and only -when -.B POSIXLY_CORRECT -is not set. . .SH NOTES This man page is maintained only fitfully; the full documentation is often more up-to-date. . .SH COPYRIGHT -Copyright 1998-2000, 2002, 2005-2022 Free Software Foundation, Inc. +Copyright 1998-2000, 2002, 2005-2023 Free Software Foundation, Inc. .PP This is free software; see the source for copying conditions. Только в grep-3.11-alt1/doc: grep.info diff -ur grep-3.7-alt1/doc/grep.texi grep-3.11-alt1/doc/grep.texi --- grep-3.7-alt1/doc/grep.texi 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/doc/grep.texi 2023-05-10 23:10:36.000000000 +0300 @@ -30,7 +30,7 @@ @copying This manual is for @command{grep}, a pattern matching engine. -Copyright @copyright{} 1999--2002, 2005, 2008--2022 Free Software Foundation, +Copyright @copyright{} 1999--2002, 2005, 2008--2023 Free Software Foundation, Inc. @quotation @@ -202,6 +202,7 @@ Obtain patterns from @var{file}, one per line. If this option is used multiple times or is combined with the @option{-e} (@option{--regexp}) option, search for all patterns given. +When @var{file} is @samp{-}, read patterns from standard input. The empty file contains zero patterns, and therefore matches nothing. (@option{-f} is specified by POSIX.) @@ -223,7 +224,13 @@ it yields ``S''. Another example: the lowercase German letter ``ß'' (U+00DF, LATIN SMALL LETTER SHARP S) is normally capitalized as the two-character string ``SS'' but it does not match ``SS'', and it might -not match the uppercase letter ``ẞ'' (U+1E9E, LATIN CAPITAL LETTER +not match the uppercase letter +@c texinfo version 2023-03-04.12 complains about the following, saying +@c "Character missing, sorry: LONG S." For now, omit it if tex. +@ifnottex +``ẞ'' +@end ifnottex +(U+1E9E, LATIN CAPITAL LETTER SHARP S) even though lowercasing the latter yields the former. @option{-y} is an obsolete synonym that is provided for compatibility. @@ -265,8 +272,7 @@ regular expression with @samp{\<} and @samp{\>}. For example, although @samp{grep -w @@} matches a line containing only @samp{@@}, @samp{grep '\<@@\>'} cannot match any line because @samp{@@} is not a -word constituent. @xref{The Backslash Character and Special -Expressions}. +word constituent. @xref{Special Backslash Expressions}. @item -x @itemx --line-regexp @@ -301,7 +307,7 @@ @opindex --color @opindex --colour @cindex highlight, color, colour -Surround the matched (non-empty) strings, matching lines, context lines, +Surround matched non-empty strings, matching lines, context lines, file names, line numbers, byte offsets, and separators (for fields and groups of context lines) with escape sequences to display them in color on the terminal. @@ -309,11 +315,14 @@ and default to @samp{ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36} for bold red matched text, magenta file names, green line numbers, green byte offsets, cyan separators, and default terminal colors otherwise. -The deprecated environment variable @env{GREP_COLOR} is still supported, -but its setting does not have priority; -it defaults to @samp{01;31} (bold red) -which only covers the color for matched text. -@var{WHEN} is @samp{never}, @samp{always}, or @samp{auto}. +@xref{Environment Variables}. + +@var{WHEN} is @samp{always} to use colors, @samp{never} to not use +colors, or @samp{auto} to use colors if standard output is associated +with a terminal device and the @env{TERM} environment variable's value +suggests that the terminal supports colors. +Plain @option{--color} is treated like @option{--color=auto}; +if no @option{--color} option is given, the default is @option{--color=never}. @item -L @itemx --files-without-match @@ -341,6 +350,10 @@ @opindex --max-count @cindex max-count Stop after the first @var{num} selected lines. +If @var{num} is zero, @command{grep} stops right away without reading input. +A @var{num} of @minus{}1 is treated as infinity and @command{grep} +does not stop; this is the default. + If the input is standard input from a regular file, and @var{num} selected lines are output, @command{grep} ensures that the standard input is positioned @@ -381,7 +394,7 @@ @opindex -o @opindex --only-matching @cindex only matching -Print only the matched (non-empty) parts of matching lines, +Print only the matched non-empty parts of matching lines, with each such part on a separate output line. Output lines use the same delimiters as input, and delimiters are null bytes if @option{-z} (@option{--null-data}) is also used (@pxref{Other @@ -813,8 +826,10 @@ @node Environment Variables @section Environment Variables -The behavior of @command{grep} is affected -by the following environment variables. +The behavior of @command{grep} is affected by several environment +variables, the most important of which control the locale, which +specifies how @command{grep} interprets characters in its patterns and +data. @vindex LANGUAGE @r{environment variable} @vindex LC_ALL @r{environment variable} @@ -826,8 +841,8 @@ in that order. The first of these variables that is set specifies the locale. For example, if @env{LC_ALL} is not set, -but @env{LC_COLLATE} is set to @samp{pt_BR}, -then the Brazilian Portuguese locale is used +but @env{LC_COLLATE} is set to @samp{pt_BR.UTF-8}, +then a Brazilian Portuguese locale is used for the @env{LC_COLLATE} category. As a special case for @env{LC_MESSAGES} only, the environment variable @env{LANGUAGE} can contain a colon-separated list of languages that @@ -839,7 +854,33 @@ with national language support (NLS). The shell command @code{locale -a} lists locales that are currently available. -Many of the environment variables in the following list let you +@cindex environment variables +The following environment variables affect the behavior of @command{grep}. + +@table @env + +@item GREP_COLOR +@vindex GREP_COLOR @r{environment variable} +@cindex highlight markers +This obsolescent variable interacts with @env{GREP_COLORS} +confusingly, and @command{grep} warns if it is set and is not +overridden by @env{GREP_COLORS}. Instead of +@samp{GREP_COLOR='@var{color}'}, you can use +@samp{GREP_COLORS='mt=@var{color}'}. + +@item GREP_COLORS +@vindex GREP_COLORS @r{environment variable} +@cindex highlight markers +This variable controls how the @option{--color} option highlights output. +Its value is a colon-separated list of @code{terminfo} capabilities +that defaults to @samp{ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36} +with the @samp{rv} and @samp{ne} boolean capabilities omitted (i.e., false). +The two-letter capability names +refer to terminal ``capabilities,'' the ability +of a terminal to highlight text, or change its color, and so on. +These capabilities are stored in an online database and accessed by +the @code{terminfo} library. +Non-empty capability values control highlighting using Select Graphic Rendition (SGR) commands interpreted by the terminal or terminal emulator. @@ -867,38 +908,6 @@ and @samp{48;5;0} to @samp{48;5;255} for 88-color and 256-color modes background colors. -The two-letter names used in the @env{GREP_COLORS} environment variable -(and some of the others) refer to terminal ``capabilities,'' the ability -of a terminal to highlight text, or change its color, and so on. -These capabilities are stored in an online database and accessed by -the @code{terminfo} library. - -@cindex environment variables - -@table @env - -@item GREP_COLOR -@vindex GREP_COLOR @r{environment variable} -@cindex highlight markers -This variable specifies the color used to highlight matched (non-empty) text. -It is deprecated in favor of @env{GREP_COLORS}, but still supported. -The @samp{mt}, @samp{ms}, and @samp{mc} capabilities of @env{GREP_COLORS} -have priority over it. -It can only specify the color used to highlight -the matching non-empty text in any matching line -(a selected line when the @option{-v} command-line option is omitted, -or a context line when @option{-v} is specified). -The default is @samp{01;31}, -which means a bold red foreground text on the terminal's default background. - -@item GREP_COLORS -@vindex GREP_COLORS @r{environment variable} -@cindex highlight markers -This variable specifies the colors and other attributes -used to highlight various parts of the output. -Its value is a colon-separated list of @code{terminfo} capabilities -that defaults to @samp{ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36} -with the @samp{rv} and @samp{ne} boolean capabilities omitted (i.e., false). Supported capabilities are as follows. @table @code @@ -1009,7 +1018,7 @@ @cindex national language support @cindex NLS These variables specify the locale for the @env{LC_COLLATE} category, -which might affect how range expressions like @samp{[a-z]} are +which might affect how range expressions like @samp{a-z} are interpreted. @item LC_ALL @@ -1052,20 +1061,11 @@ by default, such options are permuted to the front of the operand list and are treated as options. -Also, @env{POSIXLY_CORRECT} disables special handling of an -invalid bracket expression. @xref{invalid-bracket-expr}. -@item _@var{N}_GNU_nonoption_argv_flags_ -@vindex _@var{N}_GNU_nonoption_argv_flags_ @r{environment variable} -(Here @code{@var{N}} is @command{grep}'s numeric process ID.) -If the @var{i}th character of this environment variable's value is @samp{1}, -do not consider the @var{i}th operand of @command{grep} to be an option, -even if it appears to be one. -A shell can put this variable in the environment for each command it runs, -specifying which operands are the results of file name wildcard expansion -and therefore should not be treated as options. -This behavior is available only with the GNU C library, -and only when @env{POSIXLY_CORRECT} is not set. +@item TERM +@vindex TERM @r{environment variable} +This variable specifies the output terminal type, which can affect +what the @option{--color} option does. @xref{General Output Control}. @end table @@ -1148,6 +1148,38 @@ @samp{grep@ -P} may warn of unimplemented features. @xref{Other Options}. +For documentation, refer to @url{https://www.pcre.org/}, with these caveats: +@itemize +@item +@samp{\d} matches only the ten ASCII digits +(and @samp{\D} matches the complement), regardless of locale. +Use @samp{\p@{Nd@}} to also match non-ASCII digits. +(The behavior of @samp{\d} and @samp{\D} is unspecified after +in-regexp directives like @samp{(?aD)}.) + +@item +Although PCRE tracks the syntax and semantics of Perl's regular +expressions, the match is not always exact. For example, Perl +evolves and a Perl installation may predate or postdate the PCRE2 +installation on the same host, or their Unicode versions may differ, +or Perl and PCRE2 may disagree about an obscure construct. + +@item +By default, @command{grep} applies each regexp to a line at a time, +so the @samp{(?s)} directive (making @samp{.} match line breaks) +is generally ineffective. +However, with @option{-z} (@option{--null-data}) it can work: +@example +$ printf 'a\nb\n' |grep -zP '(?s)a.b' +a +b +@end example +But beware: with the @option{-z} (@option{--null-data}) and a file +containing no NUL byte, grep must read the entire file into memory +before processing any of it. +Thus, it will exhaust memory and fail for some large files. +@end itemize + @end table @@ -1162,22 +1194,24 @@ three different versions of regular expression syntax: basic (BRE), extended (ERE), and Perl-compatible (PCRE). In GNU @command{grep}, -there is no difference in available functionality between the basic and -extended syntaxes. -In other implementations, basic regular expressions are less powerful. +basic and extended regular expressions are merely different notations +for the same pattern-matching functionality. +In other implementations, basic regular expressions are ordinarily +less powerful than extended, though occasionally it is the other way around. The following description applies to extended regular expressions; differences for basic regular expressions are summarized afterwards. -Perl-compatible regular expressions give additional functionality, and +Perl-compatible regular expressions have different functionality, and are documented in the @i{pcre2syntax}(3) and @i{pcre2pattern}(3) manual pages, but work only if PCRE is available in the system. @menu * Fundamental Structure:: * Character Classes and Bracket Expressions:: -* The Backslash Character and Special Expressions:: +* Special Backslash Expressions:: * Anchoring:: * Back-references and Subexpressions:: * Basic vs Extended:: +* Problematic Expressions:: * Character Encoding:: * Matching Non-ASCII:: @end menu @@ -1257,9 +1291,10 @@ matches any string formed by concatenating two substrings that respectively match the concatenated expressions. -Two regular expressions may be joined by the infix operator @samp{|}; -the resulting regular expression -matches any string matching either alternate expression. +@cindex alternatives in regular expressions +Two regular expressions may be joined by the infix operator @samp{|}. +The resulting regular expression matches any string matching either of +the two expressions, which are called @dfn{alternatives}. Repetition takes precedence over concatenation, which in turn takes precedence over alternation. @@ -1267,6 +1302,9 @@ to override these precedence rules and form a subexpression. An unmatched @samp{)} matches just itself. +Not every character string is a valid regular expression. +@xref{Problematic Expressions}. + @node Character Classes and Bracket Expressions @section Character Classes and Bracket Expressions @@ -1294,7 +1332,7 @@ In other locales, the sorting sequence is not specified, and @samp{[a-d]} might be equivalent to @samp{[abcd]} or to @samp{[aBbCcDd]}, or it might fail to match any character, or the set of -characters that it matches might even be erratic. +characters that it matches might be erratic, or it might be invalid. To obtain the traditional interpretation of bracket expressions, you can use the @samp{C} locale by setting the @env{LC_ALL} environment variable to the value @samp{C}. @@ -1397,12 +1435,10 @@ part of the symbolic names, and must be included in addition to the brackets delimiting the bracket expression. -@anchor{invalid-bracket-expr} If you mistakenly omit the outer brackets, and search for say, @samp{[:upper:]}, GNU @command{grep} prints a diagnostic and exits with status 2, on -the assumption that you did not intend to search for the nominally -equivalent regular expression: @samp{[:epru]}. -Set the @env{POSIXLY_CORRECT} environment variable to disable this feature. +the assumption that you did not intend to search for the +regular expression @samp{[:epru]}. Special characters lose their special meaning inside bracket expressions. @@ -1433,7 +1469,7 @@ @item - represents the range if it's not first or last in a list or the ending point -of a range. +of a range. To make the @samp{-} a list item, it is best to put it last. @item ^ represents the characters not in the list. @@ -1442,8 +1478,8 @@ @end table -@node The Backslash Character and Special Expressions -@section The Backslash Character and Special Expressions +@node Special Backslash Expressions +@section Special Backslash Expressions @cindex backslash The @samp{\} character followed by a special character is a regular @@ -1478,11 +1514,24 @@ @item \S Match non-whitespace, it is a synonym for @samp{[^[:space:]]}. +@item \] +Match @samp{]}. + +@item \@} +Match @samp{@}}. + @end table For example, @samp{\brat\b} matches the separate word @samp{rat}, @samp{\Brat\B} matches @samp{crate} but not @samp{furry rat}. +The behavior of @command{grep} is unspecified if a unescaped backslash +is not followed by a special character, a nonzero digit, or a +character in the above list. Although @command{grep} might issue a +diagnostic and/or give the backslash an interpretation now, its +behavior may change if the syntax of regular expressions is extended +in future versions. + @node Anchoring @section Anchoring @cindex anchoring @@ -1518,48 +1567,181 @@ @section Basic vs Extended Regular Expressions @cindex basic regular expressions -In basic regular expressions the characters @samp{?}, @samp{+}, +Basic regular expressions differ from extended regular expressions +in the following ways: + +@itemize +@item +The characters @samp{?}, @samp{+}, @samp{@{}, @samp{|}, @samp{(}, and @samp{)} lose their special meaning; instead use the backslashed versions @samp{\?}, @samp{\+}, @samp{\@{}, @samp{\|}, @samp{\(}, and @samp{\)}. Also, a backslash is needed -before an interval expression's closing @samp{@}}, and an unmatched -@code{\)} is invalid. +before an interval expression's closing @samp{@}}. + +@item +An unmatched @samp{\)} is invalid. + +@item +If an unescaped @samp{^} appears neither first, nor directly after +@samp{\(} or @samp{\|}, it is treated like an ordinary character and +is not an anchor. + +@item +If an unescaped @samp{$} appears neither last, nor directly before +@samp{\|} or @samp{\)}, it is treated like an ordinary character and +is not an anchor. + +@item +If an unescaped @samp{*} appears first, or appears directly after +@samp{\(} or @samp{\|} or anchoring @samp{^}, it is treated like an +ordinary character and is not a repetition operator. +@end itemize + +@node Problematic Expressions +@section Problematic Regular Expressions -Portable scripts should avoid the following constructs, as -POSIX says they produce unspecified results: +@cindex invalid regular expressions +@cindex unspecified behavior in regular expressions +Some strings are @dfn{invalid regular expressions} and cause +@command{grep} to issue a diagnostic and fail. For example, @samp{xy\1} +is invalid because there is no parenthesized subexpression for the +back-reference @samp{\1} to refer to. + +Also, some regular expressions have @dfn{unspecified behavior} and +should be avoided even if @command{grep} does not currently diagnose +them. For example, @samp{xy\0} has unspecified behavior because +@samp{0} is not a special character and @samp{\0} is not a special +backslash expression (@pxref{Special Backslash Expressions}). +Unspecified behavior can be particularly problematic because the set +of matched strings might be only partially specified, or not be +specified at all, or the expression might even be invalid. + +The following regular expression constructs are invalid on all +platforms conforming to POSIX, so portable scripts can assume that +@command{grep} rejects these constructs: @itemize @bullet @item -Extended regular expressions that use back-references. +A basic regular expression containing a back-reference @samp{\@var{n}} +preceded by fewer than @var{n} closing parentheses. For example, +@samp{\(a\)\2} is invalid. + @item -Basic regular expressions that use @samp{\?}, @samp{\+}, or @samp{\|}. +A bracket expression containing @samp{[:} that does not start a +character class; and similarly for @samp{[=} and @samp{[.}. For +example, @samp{[a[:b]} and @samp{[a[:ouch:]b]} are invalid. +@end itemize + +GNU @command{grep} treats the following constructs as invalid. +However, other @command{grep} implementations might allow them, so +portable scripts should not rely on their being invalid: + +@itemize @bullet @item -Empty parenthesized regular expressions like @samp{()}. +Unescaped @samp{\} at the end of a regular expression. + @item -Empty alternatives (as in, e.g, @samp{a|}). +Unescaped @samp{[} that does not start a bracket expression. + @item -Repetition operators that immediately follow empty expressions, -unescaped @samp{$}, or other repetition operators. +A @samp{\@{} in a basic regular expression that does not start an +interval expression. + @item -Interval expressions containing repetition counts greater than 255. +A basic regular expression with unbalanced @samp{\(} or @samp{\)}, +or an extended regular expression with unbalanced @samp{(}. + @item -A backslash escaping an ordinary character (e.g., @samp{\S}), -unless it is a back-reference. +In the POSIX locale, a range expression like @samp{z-a} that +represents zero elements. A non-GNU @command{grep} might treat it as +a valid range that never matches. + @item -An unescaped @samp{[} that is not part of a bracket expression. +An interval expression with a repetition count greater than 32767. +(The portable POSIX limit is 255, and even interval expressions with +smaller counts can be impractically slow on all known implementations.) + @item -In extended regular expressions, an unescaped @samp{@{} that is not -part of an interval expression. +A bracket expression that contains at least three elements, the first +and last of which are both @samp{:}, or both @samp{.}, or both +@samp{=}. For example, a non-GNU @command{grep} might treat +@samp{[:alpha:]} like @samp{[[:alpha:]]}, or like @samp{[:ahlp]}. @end itemize -@cindex interval expressions -GNU @samp{grep@ -E} treats @samp{@{} as special -only if it begins a valid interval expression. -For example, the command -@samp{grep@ -E@ '@{1'} searches for the two-character string @samp{@{1} -instead of reporting a syntax error in the regular expression. -POSIX allows this behavior as an extension, but portable scripts -should avoid it. +The following constructs have well-defined behavior in GNU +@command{grep}. However, they have unspecified behavior elsewhere, so +portable scripts should avoid them: + +@itemize @bullet +@item +Special backslash expressions like @samp{\b}, @samp{\<}, and @samp{\]}. +@xref{Special Backslash Expressions}. + +@item +A basic regular expression that uses @samp{\?}, @samp{\+}, or @samp{\|}. + +@item +An extended regular expression that uses back-references. + +@item +An empty regular expression, subexpression, or alternative. For +example, @samp{(a|bc|)} is not portable; a portable equivalent is +@samp{(a|bc)?}. + +@item +In a basic regular expression, an anchoring @samp{^} that appears +directly after @samp{\(}, or an anchoring @samp{$} that appears +directly before @samp{\)}. + +@item +In a basic regular expression, a repetition operator that +directly follows another repetition operator. + +@item +In an extended regular expression, unescaped @samp{@{} +that does not begin a valid interval expression. +GNU @command{grep} treats the @samp{@{} as an ordinary character. + +@item +A null character or an encoding error in either pattern or input data. +@xref{Character Encoding}. + +@item +An input file that ends in a non-newline character, +where GNU @command{grep} silently supplies a newline. +@end itemize + +The following constructs have unspecified behavior, in both GNU +and other @command{grep} implementations. Scripts should avoid +them whenever possible. + +@itemize +@item +A backslash escaping an ordinary character, unless it is a +back-reference like @samp{\1} or a special backslash expression like +@samp{\<} or @samp{\b}. @xref{Special Backslash Expressions}. For +example, @samp{\x} has unspecified behavior now, and a future version +of @command{grep} might specify @samp{\x} to have a new behavior. + +@item +A repetition operator that appears directly after an anchor, or at the +start of a complete regular expression, parenthesized subexpression, +or alternative. For example, @samp{+|^*(+a|?-b)} has unspecified +behavior, whereas @samp{\+|^\*(\+a|\?-b)} is portable. + +@item +A range expression outside the POSIX locale. For example, in some +locales @samp{[a-z]} might match some characters that are not +lowercase letters, or might not match some lowercase letters, or might +be invalid. With GNU @command{grep} it is not documented whether +these range expressions use native code points, or use the collating +sequence specified by the @env{LC_COLLATE} category, or have some +other interpretation. Outside the POSIX locale, it is portable to use +@samp{[[:lower:]]} to match a lower-case letter, or +@samp{[abcdefghijklmnopqrstuvwxyz]} to match an ASCII lower-case +letter. + +@end itemize @node Character Encoding @section Character Encoding @@ -1865,7 +2047,10 @@ To match empty lines, use the pattern @samp{^$}. To match blank lines, use the pattern @samp{^[[:blank:]]*$}. To match no lines at -all, use the command @samp{grep -f /dev/null}. +all, use an extended regular expression like @samp{a^} or @samp{$a}. +To match every line, a portable script should use a pattern like +@samp{^} instead of the empty pattern, as POSIX does not specify the +behavior of the empty pattern. @item How can I search in both standard input and in files? @@ -1947,12 +2132,12 @@ that were the counterparts of the modern @samp{grep -E} and @samp{grep -F}. Although breaking up @command{grep} into three programs was perhaps useful on the small computers of the 1970s, @command{egrep} and -@command{fgrep} were not standardized by POSIX and are no longer needed. -In the current GNU implementation, @command{egrep} and @command{fgrep} -issue a warning and then act like their modern counterparts; +@command{fgrep} were deemed obsolescent by POSIX in 1992, +removed from POSIX in 2001, deprecated by GNU Grep 2.5.3 in 2007, +and changed to issue obsolescence warnings by GNU Grep 3.8 in 2022; eventually, they are planned to be removed entirely. -If you prefer the old names, you can use use your own substitutes, +If you prefer the old names, you can use your own substitutes, such as a shell script named @command{egrep} with the following contents: diff -ur grep-3.7-alt1/doc/Makefile.am grep-3.11-alt1/doc/Makefile.am --- grep-3.7-alt1/doc/Makefile.am 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/doc/Makefile.am 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ # Process this file with automake to create Makefile.in # Makefile.am for grep/doc. # -# Copyright 2008-2022 Free Software Foundation, Inc. +# Copyright 2008-2023 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by Только в grep-3.11-alt1/doc: Makefile.in Только в grep-3.11-alt1/doc: stamp-vti Только в grep-3.11-alt1/doc: version.texi Только в grep-3.7-alt1: .gitattributes Только в grep-3.7-alt1: .gitignore Только в grep-3.7-alt1: .gitmodules Только в grep-3.7-alt1: gnulib Только в grep-3.11-alt1/gnulib-tests: accept.c Только в grep-3.11-alt1/gnulib-tests: alloca.c Только в grep-3.11-alt1/gnulib-tests: altstack-util.h Только в grep-3.11-alt1/gnulib-tests: anytostr.c Только в grep-3.11-alt1/gnulib-tests: arg-nonnull.h Только в grep-3.11-alt1/gnulib-tests: arpa_inet.in.h Только в grep-3.11-alt1/gnulib-tests: asnprintf.c Только в grep-3.11-alt1/gnulib-tests: bind.c Только в grep-3.11-alt1/gnulib-tests: c++defs.h Только в grep-3.11-alt1/gnulib-tests: connect.c Только в grep-3.11-alt1/gnulib-tests: c-strcasestr.c Только в grep-3.11-alt1/gnulib-tests: c-strcasestr.h Только в grep-3.11-alt1/gnulib-tests: fdopen.c Только в grep-3.11-alt1/gnulib-tests: float.c Только в grep-3.11-alt1/gnulib-tests: float+.h Только в grep-3.11-alt1/gnulib-tests: float.in.h Только в grep-3.11-alt1/gnulib-tests: fpucw.h Только в grep-3.11-alt1/gnulib-tests: ftruncate.c Только в grep-3.11-alt1/gnulib-tests: gettimeofday.c Только в grep-3.11-alt1/gnulib-tests: glthread Только в grep-3.11-alt1/gnulib-tests: gnulib.mk Только в grep-3.11-alt1/gnulib-tests: hash-pjw.c Только в grep-3.11-alt1/gnulib-tests: hash-pjw.h Только в grep-3.11-alt1/gnulib-tests: imaxtostr.c Только в grep-3.11-alt1/gnulib-tests: inet_pton.c Только в grep-3.11-alt1/gnulib-tests: init.sh Только в grep-3.11-alt1/gnulib-tests: inttostr.c Только в grep-3.11-alt1/gnulib-tests: inttostr.h Только в grep-3.11-alt1/gnulib-tests: ioctl.c Только в grep-3.11-alt1/gnulib-tests: itold.c Только в grep-3.11-alt1/gnulib-tests: listen.c Только в grep-3.11-alt1/gnulib-tests: locale.c Только в grep-3.11-alt1/gnulib-tests: localename.c Только в grep-3.11-alt1/gnulib-tests: localename.h Только в grep-3.11-alt1/gnulib-tests: localename-table.c Только в grep-3.11-alt1/gnulib-tests: localename-table.h Только в grep-3.11-alt1/gnulib-tests: macros.h Только в grep-3.11-alt1/gnulib-tests: Makefile.in Только в grep-3.11-alt1/gnulib-tests: mmap-anon-util.h Только в grep-3.11-alt1/gnulib-tests: nan.h Только в grep-3.11-alt1/gnulib-tests: nanosleep.c Только в grep-3.11-alt1/gnulib-tests: nap.h Только в grep-3.11-alt1/gnulib-tests: netinet_in.in.h Только в grep-3.11-alt1/gnulib-tests: _Noreturn.h Только в grep-3.11-alt1/gnulib-tests: offtostr.c Только в grep-3.11-alt1/gnulib-tests: perror.c Только в grep-3.11-alt1/gnulib-tests: printf-args.c Только в grep-3.11-alt1/gnulib-tests: printf-args.h Только в grep-3.11-alt1/gnulib-tests: printf-parse.c Только в grep-3.11-alt1/gnulib-tests: printf-parse.h Только в grep-3.11-alt1/gnulib-tests: pselect.c Только в grep-3.11-alt1/gnulib-tests: pthread.in.h Только в grep-3.11-alt1/gnulib-tests: pthread_sigmask.c Только в grep-3.11-alt1/gnulib-tests: pthread-thread.c Только в grep-3.11-alt1/gnulib-tests: putenv.c Только в grep-3.11-alt1/gnulib-tests: sched.in.h Только в grep-3.11-alt1/gnulib-tests: select.c Только в grep-3.11-alt1/gnulib-tests: setenv.c Только в grep-3.11-alt1/gnulib-tests: setlocale.c Только в grep-3.11-alt1/gnulib-tests: setsockopt.c Только в grep-3.11-alt1/gnulib-tests: signature.h Только в grep-3.11-alt1/gnulib-tests: sigprocmask.c Только в grep-3.11-alt1/gnulib-tests: size_max.h Только в grep-3.11-alt1/gnulib-tests: sleep.c Только в grep-3.11-alt1/gnulib-tests: snprintf.c Только в grep-3.11-alt1/gnulib-tests: socket.c Только в grep-3.11-alt1/gnulib-tests: sockets.c Только в grep-3.11-alt1/gnulib-tests: sockets.h Только в grep-3.11-alt1/gnulib-tests: strerror_r.c Только в grep-3.11-alt1/gnulib-tests: str-two-way.h Только в grep-3.11-alt1/gnulib-tests: symlink.c Только в grep-3.11-alt1/gnulib-tests: sys_ioctl.in.h Только в grep-3.11-alt1/gnulib-tests: sys_select.in.h Только в grep-3.11-alt1/gnulib-tests: sys_socket.c Только в grep-3.11-alt1/gnulib-tests: sys_socket.in.h Только в grep-3.11-alt1/gnulib-tests: sys_time.in.h Только в grep-3.11-alt1/gnulib-tests: sys_uio.in.h Только в grep-3.11-alt1/gnulib-tests: test-accept.c Только в grep-3.11-alt1/gnulib-tests: test-alignasof.c Только в grep-3.11-alt1/gnulib-tests: test-alignof.c Только в grep-3.11-alt1/gnulib-tests: test-alloca-opt.c Только в grep-3.11-alt1/gnulib-tests: test-argmatch.c Только в grep-3.11-alt1/gnulib-tests: test-arpa_inet.c Только в grep-3.11-alt1/gnulib-tests: test-assert.c Только в grep-3.11-alt1/gnulib-tests: test-binary-io.c Только в grep-3.11-alt1/gnulib-tests: test-binary-io.sh Только в grep-3.11-alt1/gnulib-tests: test-bind.c Только в grep-3.11-alt1/gnulib-tests: test-bitrotate.c Только в grep-3.11-alt1/gnulib-tests: test-btowc1.sh Только в grep-3.11-alt1/gnulib-tests: test-btowc2.sh Только в grep-3.11-alt1/gnulib-tests: test-btowc3.sh Только в grep-3.11-alt1/gnulib-tests: test-btowc.c Только в grep-3.11-alt1/gnulib-tests: test-calloc-gnu.c Только в grep-3.11-alt1/gnulib-tests: test-c-ctype.c Только в grep-3.11-alt1/gnulib-tests: test-chdir.c Только в grep-3.11-alt1/gnulib-tests: test-cloexec.c Только в grep-3.11-alt1/gnulib-tests: test-close.c Только в grep-3.11-alt1/gnulib-tests: test-connect.c Только в grep-3.11-alt1/gnulib-tests: test-c-stack2.sh Только в grep-3.11-alt1/gnulib-tests: test-c-stack.c Только в grep-3.11-alt1/gnulib-tests: test-c-stack.sh Только в grep-3.11-alt1/gnulib-tests: test-c-strcasecmp.c Только в grep-3.11-alt1/gnulib-tests: test-c-strcase.sh Только в grep-3.11-alt1/gnulib-tests: test-c-strcasestr.c Только в grep-3.11-alt1/gnulib-tests: test-c-strncasecmp.c Только в grep-3.11-alt1/gnulib-tests: test-ctype.c Только в grep-3.11-alt1/gnulib-tests: test-dfa-invalid-char-class.sh Только в grep-3.11-alt1/gnulib-tests: test-dfa-invalid-merge.sh Только в grep-3.11-alt1/gnulib-tests: test-dfa-match-aux.c Только в grep-3.11-alt1/gnulib-tests: test-dfa-match.sh Только в grep-3.11-alt1/gnulib-tests: test-dirent.c Только в grep-3.11-alt1/gnulib-tests: test-dup2.c Только в grep-3.11-alt1/gnulib-tests: test-dup.c Только в grep-3.11-alt1/gnulib-tests: test-dup-safer.c Только в grep-3.11-alt1/gnulib-tests: test-dynarray.c Только в grep-3.11-alt1/gnulib-tests: test-environ.c Только в grep-3.11-alt1/gnulib-tests: test-errno.c Только в grep-3.11-alt1/gnulib-tests: test-error.c Только в grep-3.11-alt1/gnulib-tests: test-error.sh Только в grep-3.11-alt1/gnulib-tests: test-exclude1.sh Только в grep-3.11-alt1/gnulib-tests: test-exclude2.sh Только в grep-3.11-alt1/gnulib-tests: test-exclude3.sh Только в grep-3.11-alt1/gnulib-tests: test-exclude4.sh Только в grep-3.11-alt1/gnulib-tests: test-exclude5.sh Только в grep-3.11-alt1/gnulib-tests: test-exclude6.sh Только в grep-3.11-alt1/gnulib-tests: test-exclude7.sh Только в grep-3.11-alt1/gnulib-tests: test-exclude8.sh Только в grep-3.11-alt1/gnulib-tests: test-exclude.c Только в grep-3.11-alt1/gnulib-tests: test-fchdir.c Только в grep-3.11-alt1/gnulib-tests: test-fcntl.c Только в grep-3.11-alt1/gnulib-tests: test-fcntl-h.c Только в grep-3.11-alt1/gnulib-tests: test-fcntl-safer.c Только в grep-3.11-alt1/gnulib-tests: test-fdopen.c Только в grep-3.11-alt1/gnulib-tests: test-fdopendir.c Только в grep-3.11-alt1/gnulib-tests: test-fgetc.c Только в grep-3.11-alt1/gnulib-tests: test-float.c Только в grep-3.11-alt1/gnulib-tests: test-fnmatch.c Только в grep-3.11-alt1/gnulib-tests: test-fnmatch-h.c Только в grep-3.11-alt1/gnulib-tests: test-fopen.c Только в grep-3.11-alt1/gnulib-tests: test-fopen-gnu.c Только в grep-3.11-alt1/gnulib-tests: test-fopen.h Только в grep-3.11-alt1/gnulib-tests: test-fpending.c Только в grep-3.11-alt1/gnulib-tests: test-fpending.sh Только в grep-3.11-alt1/gnulib-tests: test-fputc.c Только в grep-3.11-alt1/gnulib-tests: test-fread.c Только в grep-3.11-alt1/gnulib-tests: test-free.c Только в grep-3.11-alt1/gnulib-tests: test-fstatat.c Только в grep-3.11-alt1/gnulib-tests: test-fstat.c Только в grep-3.11-alt1/gnulib-tests: test-ftruncate.c Только в grep-3.11-alt1/gnulib-tests: test-ftruncate.sh Только в grep-3.11-alt1/gnulib-tests: test-fwrite.c Только в grep-3.11-alt1/gnulib-tests: test-getcwd-lgpl.c Только в grep-3.11-alt1/gnulib-tests: test-getdtablesize.c Только в grep-3.11-alt1/gnulib-tests: test-getopt-gnu.c Только в grep-3.11-alt1/gnulib-tests: test-getopt.h Только в grep-3.11-alt1/gnulib-tests: test-getopt_long.h Только в grep-3.11-alt1/gnulib-tests: test-getopt-main.h Только в grep-3.11-alt1/gnulib-tests: test-getopt-posix.c Только в grep-3.11-alt1/gnulib-tests: test-getprogname.c Только в grep-3.11-alt1/gnulib-tests: test-gettimeofday.c Только в grep-3.11-alt1/gnulib-tests: test-hard-locale.c Только в grep-3.11-alt1/gnulib-tests: test-hash.c Только в grep-3.11-alt1/gnulib-tests: test-iconv.c Только в grep-3.11-alt1/gnulib-tests: test-iconv-h.c Только в grep-3.11-alt1/gnulib-tests: test-ignore-value.c Только в grep-3.11-alt1/gnulib-tests: test-inet_pton.c Только в grep-3.11-alt1/gnulib-tests: test-init.sh Только в grep-3.11-alt1/gnulib-tests: test-intprops.c Только в grep-3.11-alt1/gnulib-tests: test-inttostr.c Только в grep-3.11-alt1/gnulib-tests: test-inttypes.c Только в grep-3.11-alt1/gnulib-tests: test-ioctl.c Только в grep-3.11-alt1/gnulib-tests: test-i-ring.c Только в grep-3.11-alt1/gnulib-tests: test-isatty.c Только в grep-3.11-alt1/gnulib-tests: test-isblank.c Только в grep-3.11-alt1/gnulib-tests: test-iswblank.c Только в grep-3.11-alt1/gnulib-tests: test-iswdigit.c Только в grep-3.11-alt1/gnulib-tests: test-iswdigit.sh Только в grep-3.11-alt1/gnulib-tests: test-iswxdigit.c Только в grep-3.11-alt1/gnulib-tests: test-iswxdigit.sh Только в grep-3.11-alt1/gnulib-tests: test-langinfo.c Только в grep-3.11-alt1/gnulib-tests: test-largefile.c Только в grep-3.11-alt1/gnulib-tests: test-limits-h.c Только в grep-3.11-alt1/gnulib-tests: test-listen.c Только в grep-3.11-alt1/gnulib-tests: test-localcharset.c Только в grep-3.11-alt1/gnulib-tests: test-locale.c Только в grep-3.11-alt1/gnulib-tests: test-localeconv.c Только в grep-3.11-alt1/gnulib-tests: test-localename.c Только в grep-3.11-alt1/gnulib-tests: test-lseek.c Только в grep-3.11-alt1/gnulib-tests: test-lseek.sh Только в grep-3.11-alt1/gnulib-tests: test-lstat.c Только в grep-3.11-alt1/gnulib-tests: test-lstat.h Только в grep-3.11-alt1/gnulib-tests: test-malloca.c Только в grep-3.11-alt1/gnulib-tests: test-malloc-gnu.c Только в grep-3.11-alt1/gnulib-tests: test-mbrlen1.sh Только в grep-3.11-alt1/gnulib-tests: test-mbrlen2.sh Только в grep-3.11-alt1/gnulib-tests: test-mbrlen3.sh Только в grep-3.11-alt1/gnulib-tests: test-mbrlen4.sh Только в grep-3.11-alt1/gnulib-tests: test-mbrlen5.sh Только в grep-3.11-alt1/gnulib-tests: test-mbrlen.c Только в grep-3.11-alt1/gnulib-tests: test-mbrlen-w32-1.sh Только в grep-3.11-alt1/gnulib-tests: test-mbrlen-w32-2.sh Только в grep-3.11-alt1/gnulib-tests: test-mbrlen-w32-3.sh Только в grep-3.11-alt1/gnulib-tests: test-mbrlen-w32-4.sh Только в grep-3.11-alt1/gnulib-tests: test-mbrlen-w32-5.sh Только в grep-3.11-alt1/gnulib-tests: test-mbrlen-w32-6.sh Только в grep-3.11-alt1/gnulib-tests: test-mbrlen-w32-7.sh Только в grep-3.11-alt1/gnulib-tests: test-mbrlen-w32.c Только в grep-3.11-alt1/gnulib-tests: test-mbscasecmp.c Только в grep-3.11-alt1/gnulib-tests: test-mbscasecmp.sh Только в grep-3.11-alt1/gnulib-tests: test-mbsinit.c Только в grep-3.11-alt1/gnulib-tests: test-mbsinit.sh Только в grep-3.11-alt1/gnulib-tests: test-mbsrtowcs1.sh Только в grep-3.11-alt1/gnulib-tests: test-mbsrtowcs2.sh Только в grep-3.11-alt1/gnulib-tests: test-mbsrtowcs3.sh Только в grep-3.11-alt1/gnulib-tests: test-mbsrtowcs4.sh Только в grep-3.11-alt1/gnulib-tests: test-mbsrtowcs5.sh Только в grep-3.11-alt1/gnulib-tests: test-mbsrtowcs.c Только в grep-3.11-alt1/gnulib-tests: test-mbsstr1.c Только в grep-3.11-alt1/gnulib-tests: test-mbsstr2.c Только в grep-3.11-alt1/gnulib-tests: test-mbsstr2.sh Только в grep-3.11-alt1/gnulib-tests: test-mbsstr3.c Только в grep-3.11-alt1/gnulib-tests: test-mbsstr3.sh Только в grep-3.11-alt1/gnulib-tests: test-memchr2.c Только в grep-3.11-alt1/gnulib-tests: test-memchr.c Только в grep-3.11-alt1/gnulib-tests: test-memrchr.c Только в grep-3.11-alt1/gnulib-tests: test-nanosleep.c Только в grep-3.11-alt1/gnulib-tests: test-netinet_in.c Только в grep-3.11-alt1/gnulib-tests: test-nl_langinfo1.c Только в grep-3.11-alt1/gnulib-tests: test-nl_langinfo1.sh Только в grep-3.11-alt1/gnulib-tests: test-nl_langinfo2.c Только в grep-3.11-alt1/gnulib-tests: test-nl_langinfo2.sh Только в grep-3.11-alt1/gnulib-tests: test-nl_langinfo-mt.c Только в grep-3.11-alt1/gnulib-tests: test-openat.c Только в grep-3.11-alt1/gnulib-tests: test-openat-safer.c Только в grep-3.11-alt1/gnulib-tests: test-open.c Только в grep-3.11-alt1/gnulib-tests: test-open.h Только в grep-3.11-alt1/gnulib-tests: test-pathmax.c Только в grep-3.11-alt1/gnulib-tests: test-perror2.c Только в grep-3.11-alt1/gnulib-tests: test-perror.c Только в grep-3.11-alt1/gnulib-tests: test-perror.sh Только в grep-3.11-alt1/gnulib-tests: test-pipe.c Только в grep-3.11-alt1/gnulib-tests: test-pselect.c Только в grep-3.11-alt1/gnulib-tests: test-pthread.c Только в grep-3.11-alt1/gnulib-tests: test-pthread_sigmask1.c Только в grep-3.11-alt1/gnulib-tests: test-pthread_sigmask2.c Только в grep-3.11-alt1/gnulib-tests: test-pthread-thread.c Только в grep-3.11-alt1/gnulib-tests: test-quotearg.h Только в grep-3.11-alt1/gnulib-tests: test-quotearg-simple.c Только в grep-3.11-alt1/gnulib-tests: test-raise.c Только в grep-3.11-alt1/gnulib-tests: test-rawmemchr.c Только в grep-3.11-alt1/gnulib-tests: test-read.c Только в grep-3.11-alt1/gnulib-tests: test-reallocarray.c Только в grep-3.11-alt1/gnulib-tests: test-realloc-gnu.c Только в grep-3.11-alt1/gnulib-tests: test-regex.c Только в grep-3.11-alt1/gnulib-tests: test-sched.c Только в grep-3.11-alt1/gnulib-tests: test-select.c Только в grep-3.11-alt1/gnulib-tests: test-select-fd.c Только в grep-3.11-alt1/gnulib-tests: test-select.h Только в grep-3.11-alt1/gnulib-tests: test-select-in.sh Только в grep-3.11-alt1/gnulib-tests: test-select-out.sh Только в grep-3.11-alt1/gnulib-tests: test-select-stdin.c Только в grep-3.11-alt1/gnulib-tests: test-setenv.c Только в grep-3.11-alt1/gnulib-tests: test-setlocale1.c Только в grep-3.11-alt1/gnulib-tests: test-setlocale1.sh Только в grep-3.11-alt1/gnulib-tests: test-setlocale2.c Только в grep-3.11-alt1/gnulib-tests: test-setlocale2.sh Только в grep-3.11-alt1/gnulib-tests: test-setlocale_null.c Только в grep-3.11-alt1/gnulib-tests: test-setlocale_null-mt-all.c Только в grep-3.11-alt1/gnulib-tests: test-setlocale_null-mt-one.c Только в grep-3.11-alt1/gnulib-tests: test-setsockopt.c Только в grep-3.11-alt1/gnulib-tests: test-signal-h.c Только в grep-3.11-alt1/gnulib-tests: test-sigprocmask.c Только в grep-3.11-alt1/gnulib-tests: test-sigsegv-catch-segv1.c Только в grep-3.11-alt1/gnulib-tests: test-sigsegv-catch-segv2.c Только в grep-3.11-alt1/gnulib-tests: test-sigsegv-catch-stackoverflow1.c Только в grep-3.11-alt1/gnulib-tests: test-sigsegv-catch-stackoverflow2.c Только в grep-3.11-alt1/gnulib-tests: test-sleep.c Только в grep-3.11-alt1/gnulib-tests: test-snprintf.c Только в grep-3.11-alt1/gnulib-tests: test-sockets.c Только в grep-3.11-alt1/gnulib-tests: test-stat.c Только в grep-3.11-alt1/gnulib-tests: test-stat.h Только в grep-3.11-alt1/gnulib-tests: test-stat-time.c Только в grep-3.11-alt1/gnulib-tests: test-stdbool.c Только в grep-3.11-alt1/gnulib-tests: test-stdckdint.c Только в grep-3.11-alt1/gnulib-tests: test-stddef.c Только в grep-3.11-alt1/gnulib-tests: test-stdint.c Только в grep-3.11-alt1/gnulib-tests: test-stdio.c Только в grep-3.11-alt1/gnulib-tests: test-stdlib.c Только в grep-3.11-alt1/gnulib-tests: test-strerror.c Только в grep-3.11-alt1/gnulib-tests: test-strerror_r.c Только в grep-3.11-alt1/gnulib-tests: test-striconv.c Только в grep-3.11-alt1/gnulib-tests: test-string.c Только в grep-3.11-alt1/gnulib-tests: test-strnlen.c Только в grep-3.11-alt1/gnulib-tests: test-strstr.c Только в grep-3.11-alt1/gnulib-tests: test-strtoimax.c Только в grep-3.11-alt1/gnulib-tests: test-strtoll.c Только в grep-3.11-alt1/gnulib-tests: test-strtoull.c Только в grep-3.11-alt1/gnulib-tests: test-strtoumax.c Только в grep-3.11-alt1/gnulib-tests: test-symlink.c Только в grep-3.11-alt1/gnulib-tests: test-symlink.h Только в grep-3.11-alt1/gnulib-tests: test-sys_ioctl.c Только в grep-3.11-alt1/gnulib-tests: test-sys_select.c Только в grep-3.11-alt1/gnulib-tests: test-sys_socket.c Только в grep-3.11-alt1/gnulib-tests: test-sys_stat.c Только в grep-3.11-alt1/gnulib-tests: test-sys_time.c Только в grep-3.11-alt1/gnulib-tests: test-sys_types.c Только в grep-3.11-alt1/gnulib-tests: test-sys_uio.c Только в grep-3.11-alt1/gnulib-tests: test-sys_wait.h Только в grep-3.11-alt1/gnulib-tests: test-thread_create.c Только в grep-3.11-alt1/gnulib-tests: test-thread_self.c Только в grep-3.11-alt1/gnulib-tests: test-time.c Только в grep-3.11-alt1/gnulib-tests: test-time-h.c Только в grep-3.11-alt1/gnulib-tests: test-trim1.sh Только в grep-3.11-alt1/gnulib-tests: test-trim2.sh Только в grep-3.11-alt1/gnulib-tests: test-trim3.sh Только в grep-3.11-alt1/gnulib-tests: test-trim.c Только в grep-3.11-alt1/gnulib-tests: test-unistd.c Только в grep-3.11-alt1/gnulib-tests: test-unsetenv.c Только в grep-3.11-alt1/gnulib-tests: test-vasnprintf.c Только в grep-3.11-alt1/gnulib-tests: test-vc-list-files-cvs.sh Только в grep-3.11-alt1/gnulib-tests: test-vc-list-files-git.sh Только в grep-3.11-alt1/gnulib-tests: test-verify.c Только в grep-3.11-alt1/gnulib-tests: test-verify.sh Только в grep-3.11-alt1/gnulib-tests: test-verify-try.c Только в grep-3.11-alt1/gnulib-tests: test-version-etc.c Только в grep-3.11-alt1/gnulib-tests: test-version-etc.sh Только в grep-3.11-alt1/gnulib-tests: test-wchar.c Только в grep-3.11-alt1/gnulib-tests: test-wcrtomb.c Только в grep-3.11-alt1/gnulib-tests: test-wcrtomb.sh Только в grep-3.11-alt1/gnulib-tests: test-wcrtomb-w32-1.sh Только в grep-3.11-alt1/gnulib-tests: test-wcrtomb-w32-2.sh Только в grep-3.11-alt1/gnulib-tests: test-wcrtomb-w32-3.sh Только в grep-3.11-alt1/gnulib-tests: test-wcrtomb-w32-4.sh Только в grep-3.11-alt1/gnulib-tests: test-wcrtomb-w32-5.sh Только в grep-3.11-alt1/gnulib-tests: test-wcrtomb-w32-6.sh Только в grep-3.11-alt1/gnulib-tests: test-wcrtomb-w32-7.sh Только в grep-3.11-alt1/gnulib-tests: test-wcrtomb-w32.c Только в grep-3.11-alt1/gnulib-tests: test-wctype-h.c Только в grep-3.11-alt1/gnulib-tests: test-wcwidth.c Только в grep-3.11-alt1/gnulib-tests: test-xalloc-die.c Только в grep-3.11-alt1/gnulib-tests: test-xalloc-die.sh Только в grep-3.11-alt1/gnulib-tests: test-xstrtoimax.c Только в grep-3.11-alt1/gnulib-tests: test-xstrtoimax.sh Только в grep-3.11-alt1/gnulib-tests: test-xstrtol.c Только в grep-3.11-alt1/gnulib-tests: test-xstrtol.sh Только в grep-3.11-alt1/gnulib-tests: test-xstrtoul.c Только в grep-3.11-alt1/gnulib-tests: test-year2038.c Только в grep-3.11-alt1/gnulib-tests: thread-optim.h Только в grep-3.11-alt1/gnulib-tests: time.c Только в grep-3.11-alt1/gnulib-tests: uinttostr.c Только в grep-3.11-alt1/gnulib-tests: umaxtostr.c Только в grep-3.11-alt1/gnulib-tests: unistr Только в grep-3.11-alt1/gnulib-tests: uniwidth Только в grep-3.11-alt1/gnulib-tests: unsetenv.c Только в grep-3.11-alt1/gnulib-tests: vasnprintf.c Только в grep-3.11-alt1/gnulib-tests: vasnprintf.h Только в grep-3.11-alt1/gnulib-tests: w32sock.h Только в grep-3.11-alt1/gnulib-tests: warn-on-use.h Только в grep-3.11-alt1/gnulib-tests: windows-thread.c Только в grep-3.11-alt1/gnulib-tests: windows-thread.h Только в grep-3.11-alt1/gnulib-tests: windows-tls.c Только в grep-3.11-alt1/gnulib-tests: windows-tls.h Только в grep-3.11-alt1/gnulib-tests: xsize.c Только в grep-3.11-alt1/gnulib-tests: xsize.h Только в grep-3.11-alt1/gnulib-tests: xstrtol-error.c Только в grep-3.11-alt1/gnulib-tests: xstrtol-error.h Только в grep-3.11-alt1/gnulib-tests: zerosize-ptr.h Только в grep-3.11-alt1: GNUmakefile Только в grep-3.7-alt1: HACKING Только в grep-3.11-alt1: INSTALL Только в grep-3.11-alt1/lib: alignof.h Только в grep-3.11-alt1/lib: alloca.in.h Только в grep-3.11-alt1/lib: argmatch.c Только в grep-3.11-alt1/lib: argmatch.h Только в grep-3.11-alt1/lib: arg-nonnull.h Только в grep-3.11-alt1/lib: assert.in.h Только в grep-3.11-alt1/lib: assure.h Только в grep-3.11-alt1/lib: at-func.c Только в grep-3.11-alt1/lib: attribute.h Только в grep-3.11-alt1/lib: basename-lgpl.c Только в grep-3.11-alt1/lib: basename-lgpl.h Только в grep-3.11-alt1/lib: binary-io.c Только в grep-3.11-alt1/lib: binary-io.h Только в grep-3.11-alt1/lib: bitrotate.c Только в grep-3.11-alt1/lib: bitrotate.h Только в grep-3.11-alt1/lib: btowc.c Только в grep-3.11-alt1/lib: calloc.c Только в grep-3.11-alt1/lib: c-ctype.c Только в grep-3.11-alt1/lib: c-ctype.h Только в grep-3.11-alt1/lib: c++defs.h Только в grep-3.11-alt1/lib: cdefs.h Только в grep-3.11-alt1/lib: chdir-long.c Только в grep-3.11-alt1/lib: chdir-long.h Только в grep-3.11-alt1/lib: cloexec.c Только в grep-3.11-alt1/lib: cloexec.h Только в grep-3.11-alt1/lib: close.c Только в grep-3.11-alt1/lib: closedir.c Только в grep-3.11-alt1/lib: closeout.c Только в grep-3.11-alt1/lib: closeout.h Только в grep-3.11-alt1/lib: close-stream.c Только в grep-3.11-alt1/lib: close-stream.h diff -ur grep-3.7-alt1/lib/colorize.h grep-3.11-alt1/lib/colorize.h --- grep-3.7-alt1/lib/colorize.h 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/lib/colorize.h 2023-01-02 07:36:23.000000000 +0300 @@ -1,6 +1,6 @@ /* Output colorization. - Copyright 2011-2022 Free Software Foundation, Inc. + Copyright 2011-2023 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) diff -ur grep-3.7-alt1/lib/colorize-posix.c grep-3.11-alt1/lib/colorize-posix.c --- grep-3.7-alt1/lib/colorize-posix.c 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/lib/colorize-posix.c 2023-01-02 07:36:23.000000000 +0300 @@ -1,5 +1,5 @@ /* Output colorization. - Copyright 2011-2022 Free Software Foundation, Inc. + Copyright 2011-2023 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/lib/colorize-w32.c grep-3.11-alt1/lib/colorize-w32.c --- grep-3.7-alt1/lib/colorize-w32.c 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/lib/colorize-w32.c 2023-01-02 07:36:23.000000000 +0300 @@ -1,5 +1,5 @@ /* Output colorization on MS-Windows. - Copyright 2011-2022 Free Software Foundation, Inc. + Copyright 2011-2023 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by Только в grep-3.11-alt1/lib: creat-safer.c Только в grep-3.11-alt1/lib: c-stack.c Только в grep-3.11-alt1/lib: c-stack.h Только в grep-3.11-alt1/lib: c-strcasecmp.c Только в grep-3.11-alt1/lib: c-strcaseeq.h Только в grep-3.11-alt1/lib: c-strcase.h Только в grep-3.11-alt1/lib: c-strncasecmp.c Только в grep-3.11-alt1/lib: ctype.in.h Только в grep-3.11-alt1/lib: cycle-check.c Только в grep-3.11-alt1/lib: cycle-check.h Только в grep-3.11-alt1/lib: dev-ino.h Только в grep-3.11-alt1/lib: dfa.c Только в grep-3.11-alt1/lib: dfa.h Только в grep-3.11-alt1/lib: dirent.in.h Только в grep-3.11-alt1/lib: dirent-private.h Только в grep-3.11-alt1/lib: dirfd.c Только в grep-3.11-alt1/lib: dirname.h Только в grep-3.11-alt1/lib: dirname-lgpl.c Только в grep-3.11-alt1/lib: dup2.c Только в grep-3.11-alt1/lib: dup.c Только в grep-3.11-alt1/lib: dup-safer.c Только в grep-3.11-alt1/lib: dup-safer-flag.c Только в grep-3.11-alt1/lib: dynarray.h Только в grep-3.11-alt1/lib: errno.in.h Только в grep-3.11-alt1/lib: error.c Только в grep-3.11-alt1/lib: error.in.h Только в grep-3.11-alt1/lib: exclude.c Только в grep-3.11-alt1/lib: exclude.h Только в grep-3.11-alt1/lib: exitfail.c Только в grep-3.11-alt1/lib: exitfail.h Только в grep-3.11-alt1/lib: fchdir.c Только в grep-3.11-alt1/lib: fcntl.c Только в grep-3.11-alt1/lib: fcntl--.h Только в grep-3.11-alt1/lib: fcntl.in.h Только в grep-3.11-alt1/lib: fcntl-safer.h Только в grep-3.11-alt1/lib: fd-hook.c Только в grep-3.11-alt1/lib: fd-hook.h Только в grep-3.11-alt1/lib: fdopendir.c Только в grep-3.11-alt1/lib: fd-safer.c Только в grep-3.11-alt1/lib: fd-safer-flag.c Только в grep-3.11-alt1/lib: filenamecat.h Только в grep-3.11-alt1/lib: filenamecat-lgpl.c Только в grep-3.11-alt1/lib: filename.h Только в grep-3.11-alt1/lib: flexmember.h Только в grep-3.11-alt1/lib: fnmatch.c Только в grep-3.11-alt1/lib: fnmatch.in.h Только в grep-3.11-alt1/lib: fnmatch_loop.c Только в grep-3.11-alt1/lib: fopen.c Только в grep-3.11-alt1/lib: fpending.c Только в grep-3.11-alt1/lib: fpending.h Только в grep-3.11-alt1/lib: free.c Только в grep-3.11-alt1/lib: fstatat.c Только в grep-3.11-alt1/lib: fstat.c Только в grep-3.11-alt1/lib: fts.c Только в grep-3.11-alt1/lib: fts-cycle.c Только в grep-3.11-alt1/lib: fts_.h Только в grep-3.11-alt1/lib: getcwd-lgpl.c Только в grep-3.11-alt1/lib: getdtablesize.c Только в grep-3.11-alt1/lib: getopt1.c Только в grep-3.11-alt1/lib: getopt.c Только в grep-3.11-alt1/lib: getopt-cdefs.in.h Только в grep-3.11-alt1/lib: getopt-core.h Только в grep-3.11-alt1/lib: getopt-ext.h Только в grep-3.11-alt1/lib: getopt.in.h Только в grep-3.11-alt1/lib: getopt_int.h Только в grep-3.11-alt1/lib: getopt-pfx-core.h Только в grep-3.11-alt1/lib: getopt-pfx-ext.h Только в grep-3.11-alt1/lib: getpagesize.c Только в grep-3.11-alt1/lib: getprogname.c Только в grep-3.11-alt1/lib: getprogname.h Только в grep-3.11-alt1/lib: gettext.h Только в grep-3.11-alt1/lib: glthread Только в grep-3.11-alt1/lib: gnulib.mk Только в grep-3.11-alt1/lib: hard-locale.c Только в grep-3.11-alt1/lib: hard-locale.h Только в grep-3.11-alt1/lib: hash.c Только в grep-3.11-alt1/lib: hash.h Только в grep-3.11-alt1/lib: ialloc.c Только в grep-3.11-alt1/lib: ialloc.h Только в grep-3.11-alt1/lib: iconv.c Только в grep-3.11-alt1/lib: iconv_close.c Только в grep-3.11-alt1/lib: iconv.in.h Только в grep-3.11-alt1/lib: iconv_open-aix.gperf Только в grep-3.11-alt1/lib: iconv_open-aix.h Только в grep-3.11-alt1/lib: iconv_open.c Только в grep-3.11-alt1/lib: iconv_open-hpux.gperf Только в grep-3.11-alt1/lib: iconv_open-hpux.h Только в grep-3.11-alt1/lib: iconv_open-irix.gperf Только в grep-3.11-alt1/lib: iconv_open-irix.h Только в grep-3.11-alt1/lib: iconv_open-osf.gperf Только в grep-3.11-alt1/lib: iconv_open-osf.h Только в grep-3.11-alt1/lib: iconv_open-solaris.gperf Только в grep-3.11-alt1/lib: iconv_open-solaris.h Только в grep-3.11-alt1/lib: iconv_open-zos.gperf Только в grep-3.11-alt1/lib: iconv_open-zos.h Только в grep-3.11-alt1/lib: idx.h Только в grep-3.11-alt1/lib: ignore-value.h Только в grep-3.11-alt1/lib: intprops.h Только в grep-3.11-alt1/lib: intprops-internal.h Только в grep-3.11-alt1/lib: inttypes.in.h Только в grep-3.11-alt1/lib: i-ring.c Только в grep-3.11-alt1/lib: i-ring.h Только в grep-3.11-alt1/lib: isatty.c Только в grep-3.11-alt1/lib: isblank.c Только в grep-3.11-alt1/lib: iswblank.c Только в grep-3.11-alt1/lib: iswdigit.c Только в grep-3.11-alt1/lib: iswxdigit.c Только в grep-3.11-alt1/lib: langinfo.in.h Только в grep-3.11-alt1/lib: lc-charset-dispatch.c Только в grep-3.11-alt1/lib: lc-charset-dispatch.h Только в grep-3.11-alt1/lib: libc-config.h Только в grep-3.11-alt1/lib: limits.in.h Только в grep-3.11-alt1/lib: localcharset.c Только в grep-3.11-alt1/lib: localcharset.h Только в grep-3.11-alt1/lib: localeconv.c Только в grep-3.11-alt1/lib: localeinfo.c Только в grep-3.11-alt1/lib: localeinfo.h Только в grep-3.11-alt1/lib: locale.in.h Только в grep-3.11-alt1/lib: lseek.c Только в grep-3.11-alt1/lib: lstat.c diff -ur grep-3.7-alt1/lib/Makefile.am grep-3.11-alt1/lib/Makefile.am --- grep-3.7-alt1/lib/Makefile.am 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/lib/Makefile.am 2023-01-02 07:36:23.000000000 +0300 @@ -1,4 +1,4 @@ -# Copyright 1997-1998, 2005-2022 Free Software Foundation, Inc. +# Copyright 1997-1998, 2005-2023 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by Только в grep-3.11-alt1/lib: Makefile.in Только в grep-3.11-alt1/lib: malloc Только в grep-3.11-alt1/lib: malloca.c Только в grep-3.11-alt1/lib: malloca.h Только в grep-3.11-alt1/lib: malloc.c Только в grep-3.11-alt1/lib: mbchar.c Только в grep-3.11-alt1/lib: mbchar.h Только в grep-3.11-alt1/lib: mbiter.c Только в grep-3.11-alt1/lib: mbiter.h Только в grep-3.11-alt1/lib: mbrlen.c Только в grep-3.11-alt1/lib: mbrtowc.c Только в grep-3.11-alt1/lib: mbrtowc-impl.h Только в grep-3.11-alt1/lib: mbrtowc-impl-utf8.h Только в grep-3.11-alt1/lib: mbscasecmp.c Только в grep-3.11-alt1/lib: mbsinit.c Только в grep-3.11-alt1/lib: mbslen.c Только в grep-3.11-alt1/lib: mbsrtowcs.c Только в grep-3.11-alt1/lib: mbsrtowcs-impl.h Только в grep-3.11-alt1/lib: mbsrtowcs-state.c Только в grep-3.11-alt1/lib: mbsstr.c Только в grep-3.11-alt1/lib: mbtowc.c Только в grep-3.11-alt1/lib: mbtowc-impl.h Только в grep-3.11-alt1/lib: mbtowc-lock.c Только в grep-3.11-alt1/lib: mbtowc-lock.h Только в grep-3.11-alt1/lib: mbuiter.c Только в grep-3.11-alt1/lib: mbuiter.h Только в grep-3.11-alt1/lib: memchr2.c Только в grep-3.11-alt1/lib: memchr2.h Только в grep-3.11-alt1/lib: memchr2.valgrind Только в grep-3.11-alt1/lib: memchr.c Только в grep-3.11-alt1/lib: memchr.valgrind Только в grep-3.11-alt1/lib: mempcpy.c Только в grep-3.11-alt1/lib: memrchr.c Только в grep-3.11-alt1/lib: minmax.h Только в grep-3.11-alt1/lib: msvc-inval.c Только в grep-3.11-alt1/lib: msvc-inval.h Только в grep-3.11-alt1/lib: msvc-nothrow.c Только в grep-3.11-alt1/lib: msvc-nothrow.h Только в grep-3.11-alt1/lib: nl_langinfo.c Только в grep-3.11-alt1/lib: nl_langinfo-lock.c Только в grep-3.11-alt1/lib: _Noreturn.h Только в grep-3.11-alt1/lib: obstack.c Только в grep-3.11-alt1/lib: obstack.h Только в grep-3.11-alt1/lib: openat.c Только в grep-3.11-alt1/lib: openat-die.c Только в grep-3.11-alt1/lib: openat.h Только в grep-3.11-alt1/lib: openat-priv.h Только в grep-3.11-alt1/lib: openat-proc.c Только в grep-3.11-alt1/lib: openat-safer.c Только в grep-3.11-alt1/lib: open.c Только в grep-3.11-alt1/lib: opendirat.c Только в grep-3.11-alt1/lib: opendirat.h Только в grep-3.11-alt1/lib: opendir.c Только в grep-3.11-alt1/lib: open-safer.c Только в grep-3.11-alt1/lib: pathmax.h Только в grep-3.11-alt1/lib: pipe.c Только в grep-3.11-alt1/lib: pipe-safer.c Только в grep-3.11-alt1/lib: propername.c Только в grep-3.11-alt1/lib: propername.h Только в grep-3.11-alt1/lib: quotearg.c Только в grep-3.11-alt1/lib: quotearg.h Только в grep-3.11-alt1/lib: quote.h Только в grep-3.11-alt1/lib: raise.c Только в grep-3.11-alt1/lib: rawmemchr.c Только в grep-3.11-alt1/lib: rawmemchr.valgrind Только в grep-3.11-alt1/lib: read.c Только в grep-3.11-alt1/lib: readdir.c Только в grep-3.11-alt1/lib: reallocarray.c Только в grep-3.11-alt1/lib: realloc.c Только в grep-3.11-alt1/lib: regcomp.c Только в grep-3.11-alt1/lib: regex.c Только в grep-3.11-alt1/lib: regexec.c Только в grep-3.11-alt1/lib: regex.h Только в grep-3.11-alt1/lib: regex_internal.c Только в grep-3.11-alt1/lib: regex_internal.h Только в grep-3.11-alt1/lib: safe-read.c Только в grep-3.11-alt1/lib: safe-read.h Только в grep-3.11-alt1/lib: same-inode.h Только в grep-3.11-alt1/lib: save-cwd.c Только в grep-3.11-alt1/lib: save-cwd.h Только в grep-3.11-alt1/lib: setlocale-lock.c Только в grep-3.11-alt1/lib: setlocale_null.c Только в grep-3.11-alt1/lib: setlocale_null.h Только в grep-3.11-alt1/lib: signal.in.h Только в grep-3.11-alt1/lib: sigsegv.c Только в grep-3.11-alt1/lib: sigsegv.in.h Только в grep-3.11-alt1/lib: stackvma.c Только в grep-3.11-alt1/lib: stackvma.h Только в grep-3.11-alt1/lib: stat.c Только в grep-3.11-alt1/lib: stat-time.c Только в grep-3.11-alt1/lib: stat-time.h Только в grep-3.11-alt1/lib: stat-w32.c Только в grep-3.11-alt1/lib: stat-w32.h Только в grep-3.11-alt1/lib: stdarg.in.h Только в grep-3.11-alt1/lib: stdckdint.in.h Только в grep-3.11-alt1/lib: stddef.in.h Только в grep-3.11-alt1/lib: stdint.in.h Только в grep-3.11-alt1/lib: stdio-impl.h Только в grep-3.11-alt1/lib: stdio.in.h Только в grep-3.11-alt1/lib: stdio-read.c Только в grep-3.11-alt1/lib: stdio-write.c Только в grep-3.11-alt1/lib: stdlib.in.h Только в grep-3.11-alt1/lib: stpcpy.c Только в grep-3.11-alt1/lib: strdup.c Только в grep-3.11-alt1/lib: streq.h Только в grep-3.11-alt1/lib: strerror.c Только в grep-3.11-alt1/lib: strerror-override.c Только в grep-3.11-alt1/lib: strerror-override.h Только в grep-3.11-alt1/lib: striconv.c Только в grep-3.11-alt1/lib: striconv.h Только в grep-3.11-alt1/lib: string.in.h Только в grep-3.11-alt1/lib: stripslash.c Только в grep-3.11-alt1/lib: str-kmp.h Только в grep-3.11-alt1/lib: strnlen1.c Только в grep-3.11-alt1/lib: strnlen1.h Только в grep-3.11-alt1/lib: strnlen.c Только в grep-3.11-alt1/lib: strstr.c Только в grep-3.11-alt1/lib: strtoimax.c Только в grep-3.11-alt1/lib: strtol.c Только в grep-3.11-alt1/lib: strtoll.c Только в grep-3.11-alt1/lib: strtoul.c Только в grep-3.11-alt1/lib: strtoull.c Только в grep-3.11-alt1/lib: strtoumax.c Только в grep-3.11-alt1/lib: str-two-way.h Только в grep-3.11-alt1/lib: sys-limits.h Только в grep-3.11-alt1/lib: sys_stat.in.h Только в grep-3.11-alt1/lib: sys_types.in.h Только в grep-3.11-alt1/lib: time.in.h Только в grep-3.11-alt1/lib: trim.c Только в grep-3.11-alt1/lib: trim.h Только в grep-3.11-alt1/lib: unictype Только в grep-3.11-alt1/lib: unistd.c Только в grep-3.11-alt1/lib: unistd--.h Только в grep-3.11-alt1/lib: unistd.in.h Только в grep-3.11-alt1/lib: unistd-safer.h Только в grep-3.11-alt1/lib: unistr Только в grep-3.11-alt1/lib: unistr.in.h Только в grep-3.11-alt1/lib: unitypes.in.h Только в grep-3.11-alt1/lib: uniwidth Только в grep-3.11-alt1/lib: uniwidth.in.h Только в grep-3.11-alt1/lib: unlocked-io.h Только в grep-3.11-alt1/lib: verify.h Только в grep-3.11-alt1/lib: version-etc.c Только в grep-3.11-alt1/lib: version-etc-fsf.c Только в grep-3.11-alt1/lib: version-etc.h Только в grep-3.11-alt1/lib: warn-on-use.h Только в grep-3.11-alt1/lib: wchar.in.h Только в grep-3.11-alt1/lib: wcrtomb.c Только в grep-3.11-alt1/lib: wctob.c Только в grep-3.11-alt1/lib: wctomb.c Только в grep-3.11-alt1/lib: wctomb-impl.h Только в grep-3.11-alt1/lib: wctype-h.c Только в grep-3.11-alt1/lib: wctype.in.h Только в grep-3.11-alt1/lib: wcwidth.c Только в grep-3.11-alt1/lib: windows-initguard.h Только в grep-3.11-alt1/lib: windows-mutex.c Только в grep-3.11-alt1/lib: windows-mutex.h Только в grep-3.11-alt1/lib: windows-once.c Только в grep-3.11-alt1/lib: windows-once.h Только в grep-3.11-alt1/lib: windows-recmutex.c Только в grep-3.11-alt1/lib: windows-recmutex.h Только в grep-3.11-alt1/lib: windows-rwlock.c Только в grep-3.11-alt1/lib: windows-rwlock.h Только в grep-3.11-alt1/lib: wmemchr.c Только в grep-3.11-alt1/lib: wmemchr-impl.h Только в grep-3.11-alt1/lib: wmempcpy.c Только в grep-3.11-alt1/lib: xalloc-die.c Только в grep-3.11-alt1/lib: xalloc.h Только в grep-3.11-alt1/lib: xalloc-oversized.h Только в grep-3.11-alt1/lib: xbinary-io.c Только в grep-3.11-alt1/lib: xbinary-io.h Только в grep-3.11-alt1/lib: xmalloc.c Только в grep-3.11-alt1/lib: xstriconv.c Только в grep-3.11-alt1/lib: xstriconv.h Только в grep-3.11-alt1/lib: xstrtoimax.c Только в grep-3.11-alt1/lib: xstrtol.c Только в grep-3.11-alt1/lib: xstrtol.h Только в grep-3.11-alt1/lib: xstrtoul.c Только в grep-3.11-alt1/m4: 00gnulib.m4 Только в grep-3.11-alt1/m4: absolute-header.m4 Только в grep-3.11-alt1/m4: alloca.m4 Только в grep-3.11-alt1/m4: arpa_inet_h.m4 Только в grep-3.11-alt1/m4: asm-underscore.m4 Только в grep-3.11-alt1/m4: assert_h.m4 Только в grep-3.11-alt1/m4: assert.m4 Только в grep-3.11-alt1/m4: btowc.m4 Только в grep-3.11-alt1/m4: build-to-host.m4 Только в grep-3.11-alt1/m4: builtin-expect.m4 Только в grep-3.11-alt1/m4: calloc.m4 Только в grep-3.11-alt1/m4: c-bool.m4 Только в grep-3.11-alt1/m4: chdir-long.m4 Только в grep-3.11-alt1/m4: closedir.m4 Только в grep-3.11-alt1/m4: close.m4 Только в grep-3.11-alt1/m4: codeset.m4 Только в grep-3.11-alt1/m4: configmake.m4 Только в grep-3.11-alt1/m4: c-stack.m4 Только в grep-3.11-alt1/m4: ctype_h.m4 Только в grep-3.11-alt1/m4: cycle-check.m4 Только в grep-3.11-alt1/m4: d-ino.m4 Только в grep-3.11-alt1/m4: dirent_h.m4 Только в grep-3.11-alt1/m4: dirfd.m4 Только в grep-3.11-alt1/m4: double-slash-root.m4 Только в grep-3.11-alt1/m4: d-type.m4 Только в grep-3.11-alt1/m4: dup2.m4 Только в grep-3.11-alt1/m4: dup.m4 Только в grep-3.11-alt1/m4: eealloc.m4 Только в grep-3.11-alt1/m4: environ.m4 Только в grep-3.11-alt1/m4: errno_h.m4 Только в grep-3.11-alt1/m4: error_h.m4 Только в grep-3.11-alt1/m4: error.m4 Только в grep-3.11-alt1/m4: exponentd.m4 Только в grep-3.11-alt1/m4: extensions.m4 Только в grep-3.11-alt1/m4: extern-inline.m4 Только в grep-3.11-alt1/m4: fchdir.m4 Только в grep-3.11-alt1/m4: fclose.m4 Только в grep-3.11-alt1/m4: fcntl_h.m4 Только в grep-3.11-alt1/m4: fcntl.m4 Только в grep-3.11-alt1/m4: fcntl-o.m4 Только в grep-3.11-alt1/m4: fcntl-safer.m4 Только в grep-3.11-alt1/m4: fdopendir.m4 Только в grep-3.11-alt1/m4: fdopen.m4 Только в grep-3.11-alt1/m4: fflush.m4 Только в grep-3.11-alt1/m4: filenamecat.m4 Только в grep-3.11-alt1/m4: flexmember.m4 Только в grep-3.11-alt1/m4: float_h.m4 Только в grep-3.11-alt1/m4: fnmatch_h.m4 Только в grep-3.11-alt1/m4: fnmatch.m4 Только в grep-3.11-alt1/m4: fopen.m4 Только в grep-3.11-alt1/m4: fpending.m4 Только в grep-3.11-alt1/m4: fpieee.m4 Только в grep-3.11-alt1/m4: free.m4 Только в grep-3.11-alt1/m4: fstatat.m4 Только в grep-3.11-alt1/m4: fstat.m4 Только в grep-3.11-alt1/m4: ftruncate.m4 Только в grep-3.11-alt1/m4: fts.m4 Только в grep-3.11-alt1/m4: getcwd.m4 Только в grep-3.11-alt1/m4: getdtablesize.m4 Только в grep-3.11-alt1/m4: getopt.m4 Только в grep-3.11-alt1/m4: getpagesize.m4 Только в grep-3.11-alt1/m4: getprogname.m4 Только в grep-3.11-alt1/m4: gettext.m4 Только в grep-3.11-alt1/m4: gettimeofday.m4 Только в grep-3.11-alt1/m4: gnulib-common.m4 Только в grep-3.11-alt1/m4: gnulib-comp.m4 Только в grep-3.11-alt1/m4: host-cpu-c-abi.m4 Только в grep-3.11-alt1/m4: iconv_h.m4 Только в grep-3.11-alt1/m4: iconv.m4 Только в grep-3.11-alt1/m4: iconv_open.m4 Только в grep-3.11-alt1/m4: include_next.m4 Только в grep-3.11-alt1/m4: inet_pton.m4 Только в grep-3.11-alt1/m4: __inline.m4 Только в grep-3.11-alt1/m4: inline.m4 Только в grep-3.11-alt1/m4: intlmacosx.m4 Только в grep-3.11-alt1/m4: intl-thread-locale.m4 Только в grep-3.11-alt1/m4: intmax_t.m4 Только в grep-3.11-alt1/m4: inttostr.m4 Только в grep-3.11-alt1/m4: inttypes_h.m4 Только в grep-3.11-alt1/m4: inttypes.m4 Только в grep-3.11-alt1/m4: ioctl.m4 Только в grep-3.11-alt1/m4: i-ring.m4 Только в grep-3.11-alt1/m4: isatty.m4 Только в grep-3.11-alt1/m4: isblank.m4 Только в grep-3.11-alt1/m4: iswblank.m4 Только в grep-3.11-alt1/m4: iswdigit.m4 Только в grep-3.11-alt1/m4: iswxdigit.m4 Только в grep-3.11-alt1/m4: langinfo_h.m4 Только в grep-3.11-alt1/m4: largefile.m4 Только в grep-3.11-alt1/m4: lcmessage.m4 Только в grep-3.11-alt1/m4: lib-ld.m4 Только в grep-3.11-alt1/m4: lib-link.m4 Только в grep-3.11-alt1/m4: lib-prefix.m4 Только в grep-3.11-alt1/m4: libsigsegv.m4 Только в grep-3.11-alt1/m4: libunistring-base.m4 Только в grep-3.11-alt1/m4: limits-h.m4 Только в grep-3.11-alt1/m4: localcharset.m4 Только в grep-3.11-alt1/m4: localeconv.m4 Только в grep-3.11-alt1/m4: locale-fr.m4 Только в grep-3.11-alt1/m4: locale_h.m4 Только в grep-3.11-alt1/m4: locale-ja.m4 Только в grep-3.11-alt1/m4: localename.m4 Только в grep-3.11-alt1/m4: locale-tr.m4 Только в grep-3.11-alt1/m4: locale-zh.m4 Только в grep-3.11-alt1/m4: lock.m4 Только в grep-3.11-alt1/m4: lseek.m4 Только в grep-3.11-alt1/m4: lstat.m4 Только в grep-3.11-alt1/m4: malloca.m4 Только в grep-3.11-alt1/m4: malloc.m4 Только в grep-3.11-alt1/m4: manywarnings.m4 Только в grep-3.11-alt1/m4: mbchar.m4 Только в grep-3.11-alt1/m4: mbiter.m4 Только в grep-3.11-alt1/m4: mbrlen.m4 Только в grep-3.11-alt1/m4: mbrtowc.m4 Только в grep-3.11-alt1/m4: mbsinit.m4 Только в grep-3.11-alt1/m4: mbslen.m4 Только в grep-3.11-alt1/m4: mbsrtowcs.m4 Только в grep-3.11-alt1/m4: mbstate_t.m4 Только в grep-3.11-alt1/m4: mbtowc.m4 Только в grep-3.11-alt1/m4: memchr.m4 Только в grep-3.11-alt1/m4: mempcpy.m4 Только в grep-3.11-alt1/m4: memrchr.m4 Только в grep-3.11-alt1/m4: minmax.m4 Только в grep-3.11-alt1/m4: mmap-anon.m4 Только в grep-3.11-alt1/m4: mode_t.m4 Только в grep-3.11-alt1/m4: msvc-inval.m4 Только в grep-3.11-alt1/m4: msvc-nothrow.m4 Только в grep-3.11-alt1/m4: multiarch.m4 Только в grep-3.11-alt1/m4: musl.m4 Только в grep-3.11-alt1/m4: nanosleep.m4 Только в grep-3.11-alt1/m4: netinet_in_h.m4 Только в grep-3.11-alt1/m4: nl_langinfo.m4 Только в grep-3.11-alt1/m4: nls.m4 Только в grep-3.11-alt1/m4: nocrash.m4 Только в grep-3.11-alt1/m4: obstack.m4 Только в grep-3.11-alt1/m4: off_t.m4 Только в grep-3.11-alt1/m4: openat.m4 Только в grep-3.11-alt1/m4: open-cloexec.m4 Только в grep-3.11-alt1/m4: opendir.m4 Только в grep-3.11-alt1/m4: open.m4 Только в grep-3.11-alt1/m4: open-slash.m4 Только в grep-3.11-alt1/m4: pathmax.m4 diff -ur grep-3.7-alt1/m4/pcre.m4 grep-3.11-alt1/m4/pcre.m4 --- grep-3.7-alt1/m4/pcre.m4 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/m4/pcre.m4 2023-04-30 10:01:36.000000000 +0300 @@ -1,6 +1,6 @@ # pcre.m4 - check for PCRE library support -# Copyright (C) 2010-2022 Free Software Foundation, Inc. +# Copyright (C) 2010-2023 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -21,7 +21,10 @@ use_pcre=no if test $test_pcre != no; then - PKG_CHECK_MODULES([PCRE], [libpcre2-8], [], [: ${PCRE_LIBS=-lpcre2-8}]) + + if test -z "${PCRE_CFLAGS+set}" && test -z "${PCRE_LIBS+set}"; then + PKG_CHECK_MODULES([PCRE], [libpcre2-8], [], [: ${PCRE_LIBS=-lpcre2-8}]) + fi AC_CACHE_CHECK([for pcre2_compile], [pcre_cv_have_pcre2_compile], [pcre_saved_CFLAGS=$CFLAGS Только в grep-3.11-alt1/m4: perl.m4 Только в grep-3.11-alt1/m4: perror.m4 Только в grep-3.11-alt1/m4: pipe.m4 Только в grep-3.11-alt1/m4: pkg.m4 Только в grep-3.11-alt1/m4: po.m4 Только в grep-3.11-alt1/m4: printf.m4 Только в grep-3.11-alt1/m4: progtest.m4 Только в grep-3.11-alt1/m4: pselect.m4 Только в grep-3.11-alt1/m4: pthread_h.m4 Только в grep-3.11-alt1/m4: pthread_rwlock_rdlock.m4 Только в grep-3.11-alt1/m4: pthread_sigmask.m4 Только в grep-3.11-alt1/m4: pthread-thread.m4 Только в grep-3.11-alt1/m4: putenv.m4 Только в grep-3.11-alt1/m4: quotearg.m4 Только в grep-3.11-alt1/m4: quote.m4 Только в grep-3.11-alt1/m4: raise.m4 Только в grep-3.11-alt1/m4: rawmemchr.m4 Только в grep-3.11-alt1/m4: readdir.m4 Только в grep-3.11-alt1/m4: read.m4 Только в grep-3.11-alt1/m4: reallocarray.m4 Только в grep-3.11-alt1/m4: realloc.m4 Только в grep-3.11-alt1/m4: regex.m4 Только в grep-3.11-alt1/m4: safe-read.m4 Только в grep-3.11-alt1/m4: save-cwd.m4 Только в grep-3.11-alt1/m4: sched_h.m4 Только в grep-3.11-alt1/m4: select.m4 Только в grep-3.11-alt1/m4: setenv.m4 Только в grep-3.11-alt1/m4: setlocale.m4 Только в grep-3.11-alt1/m4: setlocale_null.m4 Только в grep-3.11-alt1/m4: sigaltstack.m4 Только в grep-3.11-alt1/m4: signalblocking.m4 Только в grep-3.11-alt1/m4: signal_h.m4 Только в grep-3.11-alt1/m4: sigsegv.m4 Только в grep-3.11-alt1/m4: size_max.m4 Только в grep-3.11-alt1/m4: sleep.m4 Только в grep-3.11-alt1/m4: snprintf.m4 Только в grep-3.11-alt1/m4: socketlib.m4 Только в grep-3.11-alt1/m4: sockets.m4 Только в grep-3.11-alt1/m4: socklen.m4 Только в grep-3.11-alt1/m4: sockpfaf.m4 Только в grep-3.11-alt1/m4: ssize_t.m4 Только в grep-3.11-alt1/m4: stack-direction.m4 Только в grep-3.11-alt1/m4: stat.m4 Только в grep-3.11-alt1/m4: stat-time.m4 Только в grep-3.11-alt1/m4: stdalign.m4 Только в grep-3.11-alt1/m4: stdarg.m4 Только в grep-3.11-alt1/m4: stddef_h.m4 Только в grep-3.11-alt1/m4: stdint_h.m4 Только в grep-3.11-alt1/m4: stdint.m4 Только в grep-3.11-alt1/m4: stdio_h.m4 Только в grep-3.11-alt1/m4: stdlib_h.m4 Только в grep-3.11-alt1/m4: stpcpy.m4 Только в grep-3.11-alt1/m4: strdup.m4 Только в grep-3.11-alt1/m4: strerror.m4 Только в grep-3.11-alt1/m4: strerror_r.m4 Только в grep-3.11-alt1/m4: string_h.m4 Только в grep-3.11-alt1/m4: strnlen.m4 Только в grep-3.11-alt1/m4: strstr.m4 Только в grep-3.11-alt1/m4: strtoimax.m4 Только в grep-3.11-alt1/m4: strtoll.m4 Только в grep-3.11-alt1/m4: strtoull.m4 Только в grep-3.11-alt1/m4: strtoumax.m4 Только в grep-3.11-alt1/m4: symlink.m4 Только в grep-3.11-alt1/m4: sys_ioctl_h.m4 Только в grep-3.11-alt1/m4: sys_select_h.m4 Только в grep-3.11-alt1/m4: sys_socket_h.m4 Только в grep-3.11-alt1/m4: sys_stat_h.m4 Только в grep-3.11-alt1/m4: sys_time_h.m4 Только в grep-3.11-alt1/m4: sys_types_h.m4 Только в grep-3.11-alt1/m4: sys_uio_h.m4 Только в grep-3.11-alt1/m4: threadlib.m4 Только в grep-3.11-alt1/m4: thread.m4 Только в grep-3.11-alt1/m4: time_h.m4 Только в grep-3.11-alt1/m4: time.m4 Только в grep-3.11-alt1/m4: unistd_h.m4 Только в grep-3.11-alt1/m4: unistd-safer.m4 Только в grep-3.11-alt1/m4: unlocked-io.m4 Только в grep-3.11-alt1/m4: vasnprintf.m4 Только в grep-3.11-alt1/m4: version-etc.m4 Только в grep-3.11-alt1/m4: visibility.m4 Только в grep-3.11-alt1/m4: warnings.m4 Только в grep-3.11-alt1/m4: warn-on-use.m4 Только в grep-3.11-alt1/m4: wchar_h.m4 Только в grep-3.11-alt1/m4: wchar_t.m4 Только в grep-3.11-alt1/m4: wcrtomb.m4 Только в grep-3.11-alt1/m4: wctob.m4 Только в grep-3.11-alt1/m4: wctomb.m4 Только в grep-3.11-alt1/m4: wctype_h.m4 Только в grep-3.11-alt1/m4: wcwidth.m4 Только в grep-3.11-alt1/m4: windows-stat-inodes.m4 Только в grep-3.11-alt1/m4: wint_t.m4 Только в grep-3.11-alt1/m4: wmemchr.m4 Только в grep-3.11-alt1/m4: wmempcpy.m4 Только в grep-3.11-alt1/m4: xalloc.m4 Только в grep-3.11-alt1/m4: xsize.m4 Только в grep-3.11-alt1/m4: xstrtol.m4 Только в grep-3.11-alt1/m4: zzgnulib.m4 Только в grep-3.11-alt1: maint.mk diff -ur grep-3.7-alt1/Makefile.am grep-3.11-alt1/Makefile.am --- grep-3.7-alt1/Makefile.am 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/Makefile.am 2023-01-02 07:36:23.000000000 +0300 @@ -1,6 +1,6 @@ # Process this file with automake to create Makefile.in # -# Copyright 1997-1998, 2005-2022 Free Software Foundation, Inc. +# Copyright 1997-1998, 2005-2023 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by Только в grep-3.11-alt1: Makefile.in diff -ur grep-3.7-alt1/NEWS grep-3.11-alt1/NEWS --- grep-3.7-alt1/NEWS 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/NEWS 2023-05-13 11:13:14.000000000 +0300 @@ -1,6 +1,68 @@ GNU grep NEWS -*- outline -*- -* Noteworthy changes in release ?.? (????-??-??) [?] +* Noteworthy changes in release 3.11 (2023-05-13) [stable] + +** Bug fixes + + With -P, patterns like [\d] now work again. Fixing this has caused + grep to revert to the behavior of grep 3.8, in that patterns like \w + and \b go back to using ASCII rather than Unicode interpretations. + However, future versions of GNU grep and/or PCRE2 are likely to fix + this and change the behavior of \w and \b back to Unicode again, + without breaking [\d] as 3.10 did. + [bug introduced in grep 3.10] + + grep no longer fails on files dated after the year 2038, + when running on 32-bit x86 and ARM hosts using glibc 2.34+. + [bug introduced in grep 3.9] + + grep -P no longer fails to match patterns using negated classes + like \D or \W when linked with PCRE2 10.34 or newer. + [bug introduced in grep 3.8] + + +** Changes in behavior + + grep --version now prints a line describing the version of PCRE2 it uses. + For example, it prints this when built with the very latest from git: + grep -P uses PCRE2 10.43-DEV 2023-04-14 + or this with what's currently available in Fedora 37: + grep -P uses PCRE2 10.40 2022-04-14 + + previous versions of grep wouldn't respect the user provided settings for + PCRE_CFLAGS and PCRE_LIBS when building if a libpcre2-8 pkg-config module + was found. + + +* Noteworthy changes in release 3.10 (2023-03-22) [stable] + +** Bug fixes + + With -P, \d now matches only ASCII digits, regardless of PCRE + options/modes. The changes in grep-3.9 to make \b and \w work + properly had the undesirable side effect of making \d also match + e.g., the Arabic digits: ٠١٢٣٤٥٦٧٨٩. With grep-3.9, -P '\d+' + would match that ten-digit (20-byte) string. Now, to match such + a digit, you would use \p{Nd}. Similarly, \D is now mapped to [^0-9]. + [bug introduced in grep 3.9] + + +* Noteworthy changes in release 3.9 (2023-03-05) [stable] + +** Bug fixes + + With -P, some non-ASCII UTF8 characters were not recognized as + word-constituent due to our omission of the PCRE2_UCP flag. E.g., + given f(){ echo Perú|LC_ALL=en_US.UTF-8 grep -Po "$1"; } and + this command, echo $(f 'r\w'):$(f '.\b'), before it would print ":r". + After the fix, it prints the correct results: "rú:ú". + + When given multiple patterns the last of which has a back-reference, + grep no longer sometimes mistakenly matches lines in some cases. + [Bug#36148#13 introduced in grep 3.4] + + +* Noteworthy changes in release 3.8 (2022-09-02) [stable] ** Changes in behavior @@ -11,11 +73,41 @@ release 2.5.3 (2007), now warn that they are obsolescent and should be replaced by grep -E and grep -F. + The confusing GREP_COLOR environment variable is now obsolescent. + Instead of GREP_COLOR='xxx', use GREP_COLORS='mt=xxx'. grep now + warns if GREP_COLOR is used and is not overridden by GREP_COLORS. + Also, grep now treats GREP_COLOR like GREP_COLORS by silently + ignoring it if it attempts to inject ANSI terminal escapes. + + Regular expressions with stray backslashes now cause warnings, as + their unspecified behavior can lead to unexpected results. + For example, '\a' and 'a' are not always equivalent + . Similarly, regular expressions or + subexpressions that start with a repetition operator now also cause + warnings due to their unspecified behavior; for example, *a(+b|{1}c) + now has three reasons to warn. The warnings are intended as a + transition aid; they are likely to be errors in future releases. + + Regular expressions like [:space:] are now errors even if + POSIXLY_CORRECT is set, since POSIX now allows the GNU behavior. + ** Bug fixes + In locales using UTF-8 encoding, the regular expression '.' no + longer sometimes fails to match Unicode characters U+D400 through + U+D7FF (some Hangul Syllables, and Hangul Jamo Extended-B) and + Unicode characters U+108000 through U+10FFFF (half of Supplemental + Private Use Area plane B). + [bug introduced in grep 3.4] + The -s option no longer suppresses "binary file matches" messages. [Bug#51860 introduced in grep 3.5] +** Documentation improvements + + The manual now covers unspecified behavior in patterns like \x, (+), + and range expressions outside the POSIX locale. + * Noteworthy changes in release 3.7 (2021-08-14) [stable] @@ -1293,7 +1385,7 @@ I was changing it anyway I decided to do a general cleanup. ======================================================================== -Copyright (C) 1992, 1997-2002, 2004-2022 Free Software Foundation, Inc. +Copyright (C) 1992, 1997-2002, 2004-2023 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright Только в grep-3.11-alt1/po: af.gmo Только в grep-3.11-alt1/po: af.po Только в grep-3.11-alt1/po: be.gmo Только в grep-3.11-alt1/po: be.po Только в grep-3.11-alt1/po: bg.gmo Только в grep-3.11-alt1/po: bg.po Только в grep-3.11-alt1/po: boldquot.sed Только в grep-3.11-alt1/po: ca.gmo Только в grep-3.11-alt1/po: ca.po Только в grep-3.11-alt1/po: cs.gmo Только в grep-3.11-alt1/po: cs.po Только в grep-3.11-alt1/po: da.gmo Только в grep-3.11-alt1/po: da.po Только в grep-3.11-alt1/po: de.gmo Только в grep-3.11-alt1/po: de.po Только в grep-3.11-alt1/po: el.gmo Только в grep-3.11-alt1/po: el.po Только в grep-3.11-alt1/po: en@boldquot.header Только в grep-3.11-alt1/po: en@quot.header Только в grep-3.11-alt1/po: eo.gmo Только в grep-3.11-alt1/po: eo.po Только в grep-3.11-alt1/po: es.gmo Только в grep-3.11-alt1/po: es.po Только в grep-3.11-alt1/po: et.gmo Только в grep-3.11-alt1/po: et.po Только в grep-3.11-alt1/po: eu.gmo Только в grep-3.11-alt1/po: eu.po Только в grep-3.11-alt1/po: fi.gmo Только в grep-3.11-alt1/po: fi.po Только в grep-3.11-alt1/po: fr.gmo Только в grep-3.11-alt1/po: fr.po Только в grep-3.11-alt1/po: ga.gmo Только в grep-3.11-alt1/po: ga.po Только в grep-3.7-alt1/po: .gitignore Только в grep-3.11-alt1/po: gl.gmo Только в grep-3.11-alt1/po: gl.po Только в grep-3.11-alt1/po: grep.pot Только в grep-3.11-alt1/po: he.gmo Только в grep-3.11-alt1/po: he.po Только в grep-3.11-alt1/po: hr.gmo Только в grep-3.11-alt1/po: hr.po Только в grep-3.11-alt1/po: hu.gmo Только в grep-3.11-alt1/po: hu.po Только в grep-3.11-alt1/po: id.gmo Только в grep-3.11-alt1/po: id.po Только в grep-3.11-alt1/po: insert-header.sin Только в grep-3.11-alt1/po: it.gmo Только в grep-3.11-alt1/po: it.po Только в grep-3.11-alt1/po: ja.gmo Только в grep-3.11-alt1/po: ja.po Только в grep-3.11-alt1/po: ka.gmo Только в grep-3.11-alt1/po: ka.po Только в grep-3.11-alt1/po: ko.gmo Только в grep-3.11-alt1/po: ko.po Только в grep-3.11-alt1/po: ky.gmo Только в grep-3.11-alt1/po: ky.po Только в grep-3.11-alt1/po: LINGUAS Только в grep-3.11-alt1/po: lt.gmo Только в grep-3.11-alt1/po: lt.po Только в grep-3.11-alt1/po: Makefile.in.in Только в grep-3.11-alt1/po: Makevars Только в grep-3.11-alt1/po: nb.gmo Только в grep-3.11-alt1/po: nb.po Только в grep-3.11-alt1/po: nl.gmo Только в grep-3.11-alt1/po: nl.po Только в grep-3.11-alt1/po: pa.gmo Только в grep-3.11-alt1/po: pa.po Только в grep-3.11-alt1/po: pl.gmo Только в grep-3.11-alt1/po: pl.po diff -ur grep-3.7-alt1/po/POTFILES.in grep-3.11-alt1/po/POTFILES.in --- grep-3.7-alt1/po/POTFILES.in 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/po/POTFILES.in 2023-01-02 07:36:23.000000000 +0300 @@ -1,6 +1,6 @@ # List of files which containing translatable strings. # -# Copyright 1997-1998, 2005-2022 Free Software Foundation, Inc. +# Copyright 1997-1998, 2005-2023 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -29,5 +29,6 @@ lib/regcomp.c lib/version-etc.c lib/xalloc-die.c +src/dfasearch.c src/grep.c src/pcresearch.c Только в grep-3.11-alt1/po: pt_BR.gmo Только в grep-3.11-alt1/po: pt_BR.po Только в grep-3.11-alt1/po: pt.gmo Только в grep-3.11-alt1/po: pt.po Только в grep-3.11-alt1/po: quot.sed Только в grep-3.11-alt1/po: remove-potcdate.sin Только в grep-3.11-alt1/po: ro.gmo Только в grep-3.11-alt1/po: ro.po Только в grep-3.11-alt1/po: ru.gmo Только в grep-3.11-alt1/po: Rules-quot Только в grep-3.11-alt1/po: ru.po Только в grep-3.11-alt1/po: sk.gmo Только в grep-3.11-alt1/po: sk.po Только в grep-3.11-alt1/po: sl.gmo Только в grep-3.11-alt1/po: sl.po Только в grep-3.11-alt1/po: sr.gmo Только в grep-3.11-alt1/po: sr.po Только в grep-3.11-alt1/po: stamp-po Только в grep-3.11-alt1/po: sv.gmo Только в grep-3.11-alt1/po: sv.po Только в grep-3.11-alt1/po: ta.gmo Только в grep-3.11-alt1/po: ta.po Только в grep-3.11-alt1/po: th.gmo Только в grep-3.11-alt1/po: th.po Только в grep-3.11-alt1/po: tr.gmo Только в grep-3.11-alt1/po: tr.po Только в grep-3.11-alt1/po: uk.gmo Только в grep-3.11-alt1/po: uk.po Только в grep-3.11-alt1/po: vi.gmo Только в grep-3.11-alt1/po: vi.po Только в grep-3.11-alt1/po: zh_CN.gmo Только в grep-3.11-alt1/po: zh_CN.po Только в grep-3.11-alt1/po: zh_TW.gmo Только в grep-3.11-alt1/po: zh_TW.po Только в grep-3.7-alt1: .prev-version diff -ur grep-3.7-alt1/README grep-3.11-alt1/README --- grep-3.7-alt1/README 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/README 2023-01-02 07:36:23.000000000 +0300 @@ -1,4 +1,4 @@ - Copyright (C) 1992, 1997-2002, 2004-2022 Free Software Foundation, Inc. + Copyright (C) 1992, 1997-2002, 2004-2023 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/README-alpha grep-3.11-alt1/README-alpha --- grep-3.7-alt1/README-alpha 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/README-alpha 2023-01-02 07:36:23.000000000 +0300 @@ -1,4 +1,4 @@ - Copyright (C) 1992, 1997-2002, 2004-2022 Free Software Foundation, Inc. + Copyright (C) 1992, 1997-2002, 2004-2023 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright Только в grep-3.7-alt1: README-hacking Только в grep-3.7-alt1: README-prereq diff -ur grep-3.7-alt1/src/dfasearch.c grep-3.11-alt1/src/dfasearch.c --- grep-3.7-alt1/src/dfasearch.c 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/src/dfasearch.c 2023-01-02 07:36:23.000000000 +0300 @@ -1,5 +1,5 @@ /* dfasearch.c - searching subroutines using dfa and regex for grep. - Copyright 1992, 1998, 2000, 2007, 2009-2022 Free Software Foundation, Inc. + Copyright 1992, 1998, 2000, 2007, 2009-2023 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -53,14 +53,10 @@ die (EXIT_TROUBLE, 0, "%s", mesg); } -/* For now, the sole dfawarn-eliciting condition (use of a regexp - like '[:lower:]') is unequivocally an error, so treat it as such, - when possible. */ void dfawarn (char const *mesg) { - if (!getenv ("POSIXLY_CORRECT")) - dfaerror (mesg); + error (0, 0, _("warning: %s"), mesg); } /* If the DFA turns out to have some set of fixed strings one of @@ -148,26 +144,34 @@ idx_t pcount, idx_t lineno, reg_syntax_t syntax_bits, bool syntax_only) { - struct re_pattern_buffer pat0; - struct re_pattern_buffer *pat = syntax_only ? &pat0 : &dc->patterns[pcount]; - pat->buffer = NULL; - pat->allocated = 0; + struct re_pattern_buffer pat; + pat.buffer = NULL; + pat.allocated = 0; /* Do not use a fastmap with -i, to work around glibc Bug#20381. */ - verify (UCHAR_MAX < IDX_MAX); + static_assert (UCHAR_MAX < IDX_MAX); idx_t uchar_max = UCHAR_MAX; - pat->fastmap = (syntax_only | match_icase) ? NULL : ximalloc (uchar_max + 1); + pat.fastmap = (syntax_only | match_icase) ? NULL : ximalloc (uchar_max + 1); - pat->translate = NULL; + pat.translate = NULL; if (syntax_only) re_set_syntax (syntax_bits | RE_NO_SUB); else re_set_syntax (syntax_bits); - char const *err = re_compile_pattern (p, len, pat); + char const *err = re_compile_pattern (p, len, &pat); if (!err) - return true; + { + if (syntax_only) + regfree (&pat); + else + dc->patterns[pcount] = pat; + + return true; + } + + free (pat.fastmap); /* Emit a filename:lineno: prefix for patterns taken from files. */ idx_t pat_lineno; @@ -200,7 +204,10 @@ if (match_icase) syntax_bits |= RE_ICASE; - int dfaopts = eolbyte ? 0 : DFA_EOL_NUL; + int dfaopts = (DFA_CONFUSING_BRACKETS_ERROR | DFA_STRAY_BACKSLASH_WARN + | DFA_PLUS_WARN + | (syntax_bits & RE_CONTEXT_INDEP_OPS ? DFA_STAR_WARN : 0) + | (eolbyte ? 0 : DFA_EOL_NUL)); dfasyntax (dc->dfa, &localeinfo, syntax_bits, dfaopts); bool bs_safe = !localeinfo.multibyte | localeinfo.using_utf8; @@ -254,8 +261,6 @@ dc->patterns++; } - re_set_syntax (syntax_bits); - if (!regex_compile (dc, p, len, dc->pcount, lineno, syntax_bits, !backref)) compilation_failed = true; @@ -274,20 +279,19 @@ if (compilation_failed) exit (EXIT_TROUBLE); - if (prev <= patlim) + if (patlim < prev) + buflen--; + else if (pattern < prev) { - if (pattern < prev) - { - idx_t prevlen = patlim - prev; - buf = xirealloc (buf, buflen + prevlen); - memcpy (buf + buflen, prev, prevlen); - buflen += prevlen; - } - else - { - buf = pattern; - buflen = size; - } + idx_t prevlen = patlim - prev; + buf = xirealloc (buf, buflen + prevlen); + memcpy (buf + buflen, prev, prevlen); + buflen += prevlen; + } + else + { + buf = pattern; + buflen = size; } /* In the match_words and match_lines cases, we use a different pattern diff -ur grep-3.7-alt1/src/die.h grep-3.11-alt1/src/die.h --- grep-3.7-alt1/src/die.h 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/src/die.h 2023-01-02 07:36:23.000000000 +0300 @@ -1,5 +1,5 @@ /* Report an error and exit. - Copyright 2016-2022 Free Software Foundation, Inc. + Copyright 2016-2023 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,7 +20,6 @@ #define DIE_H #include -#include #include /* Like 'error (STATUS, ...)', except STATUS must be a nonzero constant. Только в grep-3.7-alt1/src: .gitignore diff -ur grep-3.7-alt1/src/grep.c grep-3.11-alt1/src/grep.c --- grep-3.7-alt1/src/grep.c 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/src/grep.c 2023-04-11 03:20:47.000000000 +0300 @@ -1,5 +1,5 @@ /* grep.c - main driver file for grep. - Copyright (C) 1992, 1997-2002, 2004-2022 Free Software Foundation, Inc. + Copyright (C) 1992, 1997-2002, 2004-2023 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include "system.h" @@ -40,7 +41,6 @@ #include "fcntl-safer.h" #include "fts_.h" #include "getopt.h" -#include "getprogname.h" #include "grep.h" #include "hash.h" #include "intprops.h" @@ -295,8 +295,7 @@ This only leaves red, magenta, green, and cyan (and their bold counterparts) and possibly bold blue. */ /* The color strings used for matched text. - The user can overwrite them using the deprecated - environment variable GREP_COLOR or the new GREP_COLORS. */ + The user can overwrite them using the GREP_COLORS environment variable. */ static const char *selected_match_color = "01;31"; /* bold red */ static const char *context_match_color = "01;31"; /* bold red */ @@ -899,7 +898,7 @@ add_count (intmax_t a, idx_t b) { intmax_t sum; - if (!INT_ADD_OK (a, b, &sum)) + if (ckd_add (&sum, a, b)) die (EXIT_TROUBLE, 0, _("input is too large to count")); return sum; } @@ -983,7 +982,7 @@ off_t to_be_read = st->st_size - bufoffset; ptrdiff_t a; if (0 <= to_be_read - && INT_ADD_OK (to_be_read, save + min_after_buflim, &a)) + && !ckd_add (&a, to_be_read, save + min_after_buflim)) alloc_max = MAX (a, bufalloc + incr_min); } @@ -1436,7 +1435,7 @@ /* Replace all NUL bytes in buffer P (which ends at LIM) with EOL. This avoids running out of memory when binary input contains a long sequence of zeros, which would otherwise be considered to be part - of a long line. P[LIM] should be EOL. */ + of a long line. *LIM should be EOL. */ static void zap_nuls (char *p, char *lim, char eol) { @@ -1584,7 +1583,7 @@ the buffer, 0 means there is no incomplete last line). */ oldc = beg[-1]; beg[-1] = eol; - /* FIXME: use rawmemrchr if/when it exists, since we have ensured + /* If rawmemrchr existed it could be used here, since we have ensured that this use of memrchr is guaranteed never to return NULL. */ lim = memrchr (beg - 1, eol, buflim - beg + 1); ++lim; @@ -2830,7 +2829,10 @@ version_etc (stdout, getprogname (), PACKAGE_NAME, VERSION, (char *) NULL); puts (_("Written by Mike Haertel and others; see\n" - ".")); + ".")); +#if HAVE_LIBPCRE + Pprint_version (); +#endif return EXIT_SUCCESS; } @@ -2849,8 +2851,16 @@ } else if (optind < argc) { + /* If a command-line regular expression operand starts with '\-', + skip the '\'. This suppresses a stray-backslash warning if a + script uses the non-POSIX "grep '\-x'" to avoid treating + '-x' as an option. */ + char const *pat = argv[optind++]; + bool skip_bs = (matcher != F_MATCHER_INDEX + && pat[0] == '\\' && pat[1] == '-'); + /* Make a copy so that it can be reallocated or freed later. */ - pattern_array = keys = xstrdup (argv[optind++]); + pattern_array = keys = xstrdup (pat + skip_bs); idx_t patlen = strlen (keys); keys[patlen] = '\n'; keycc = update_patterns (keys, 0, patlen + 1, ""); @@ -2912,10 +2922,21 @@ /* Legacy. */ char *userval = getenv ("GREP_COLOR"); if (userval != NULL && *userval != '\0') - selected_match_color = context_match_color = userval; + for (char *q = userval; *q == ';' || c_isdigit (*q); q++) + if (!q[1]) + { + selected_match_color = context_match_color = userval; + break; + } /* New GREP_COLORS has priority. */ parse_grep_colors (); + + /* Warn if GREP_COLOR has an effect, since it's deprecated. */ + if (selected_match_color == userval || context_match_color == userval) + error (0, 0, _("warning: GREP_COLOR='%s' is deprecated;" + " use GREP_COLORS='mt=%s'"), + userval, userval); } initialize_unibyte_mask (); diff -ur grep-3.7-alt1/src/grep.h grep-3.11-alt1/src/grep.h --- grep-3.7-alt1/src/grep.h 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/src/grep.h 2023-01-02 07:36:23.000000000 +0300 @@ -1,5 +1,5 @@ /* grep.h - interface to grep driver for searching subroutines. - Copyright (C) 1992, 1998, 2001, 2007, 2009-2022 Free Software Foundation, + Copyright (C) 1992, 1998, 2001, 2007, 2009-2023 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -20,7 +20,6 @@ #ifndef GREP_GREP_H #define GREP_GREP_H 1 -#include #include /* The following flags are exported from grep for the matchers diff -ur grep-3.7-alt1/src/kwsearch.c grep-3.11-alt1/src/kwsearch.c --- grep-3.7-alt1/src/kwsearch.c 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/src/kwsearch.c 2023-01-02 07:36:23.000000000 +0300 @@ -1,5 +1,5 @@ /* kwsearch.c - searching subroutines using kwset for grep. - Copyright 1992, 1998, 2000, 2007, 2009-2022 Free Software Foundation, Inc. + Copyright 1992, 1998, 2000, 2007, 2009-2023 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/src/kwset.c grep-3.11-alt1/src/kwset.c --- grep-3.7-alt1/src/kwset.c 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/src/kwset.c 2023-01-02 07:36:23.000000000 +0300 @@ -1,5 +1,5 @@ /* kwset.c - search for any of a set of keywords. - Copyright (C) 1989, 1998, 2000, 2005, 2007, 2009-2022 Free Software + Copyright (C) 1989, 1998, 2000, 2005, 2007, 2009-2023 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -27,10 +27,11 @@ #include "kwset.h" +#include #include #include + #include "system.h" -#include "intprops.h" #include "memchr2.h" #include "obstack.h" #include "xalloc.h" @@ -674,7 +675,7 @@ /* Significance of 12: 1 (initial offset) + 10 (skip loop) + 1 (md2). */ idx_t len12; - if (INT_MULTIPLY_OK (len, 12, &len12) && len12 < size) + if (!ckd_mul (&len12, len, 12) && len12 < size) /* 11 is not a bug, the initial offset happens only once. */ for (ep = text + size - 11 * len; tp <= ep; ) { diff -ur grep-3.7-alt1/src/kwset.h grep-3.11-alt1/src/kwset.h --- grep-3.7-alt1/src/kwset.h 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/src/kwset.h 2023-01-02 07:36:23.000000000 +0300 @@ -1,5 +1,5 @@ /* kwset.h - header declaring the keyword set library. - Copyright (C) 1989, 1998, 2005, 2007, 2009-2022 Free Software Foundation, + Copyright (C) 1989, 1998, 2005, 2007, 2009-2023 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -20,7 +20,6 @@ /* Written August 1989 by Mike Haertel. */ #include -#include #include diff -ur grep-3.7-alt1/src/Makefile.am grep-3.11-alt1/src/Makefile.am --- grep-3.7-alt1/src/Makefile.am 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/src/Makefile.am 2023-01-02 07:36:23.000000000 +0300 @@ -1,5 +1,5 @@ ## Process this file with automake to create Makefile.in -# Copyright 1997-1998, 2005-2022 Free Software Foundation, Inc. +# Copyright 1997-1998, 2005-2023 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by Только в grep-3.11-alt1/src: Makefile.in diff -ur grep-3.7-alt1/src/pcresearch.c grep-3.11-alt1/src/pcresearch.c --- grep-3.7-alt1/src/pcresearch.c 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/src/pcresearch.c 2023-04-30 10:01:41.000000000 +0300 @@ -1,5 +1,5 @@ /* pcresearch.c - searching subroutines using PCRE for grep. - Copyright 2000, 2007, 2009-2022 Free Software Foundation, Inc. + Copyright 2000, 2007, 2009-2023 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +17,12 @@ 02110-1301, USA. */ #include + #include "search.h" #include "die.h" +#include + #define PCRE2_CODE_UNIT_WIDTH 8 #include @@ -32,6 +35,18 @@ # define PCRE2_ERROR_DEPTHLIMIT PCRE2_ERROR_RECURSIONLIMIT # define pcre2_set_depth_limit pcre2_set_recursion_limit #endif +#ifndef PCRE2_EXTRA_ASCII_BSD +# define PCRE2_EXTRA_ASCII_BSD 0 +#endif + +/* Use PCRE2_MATCH_INVALID_UTF if supported and not buggy; + see . + Assume the bug will be fixed after PCRE2 10.42. */ +#if defined PCRE2_MATCH_INVALID_UTF && 10 < PCRE2_MAJOR + (42 < PCRE2_MINOR) +enum { MATCH_INVALID_UTF = PCRE2_MATCH_INVALID_UTF }; +#else +enum { MATCH_INVALID_UTF = 0 }; +#endif struct pcre_comp { @@ -68,6 +83,15 @@ free (ptr); } +void +Pprint_version (void) +{ + char buf[128]; + if (sizeof buf <= pcre2_config (PCRE2_CONFIG_VERSION, buf)) + abort (); + printf (_("\ngrep -P uses PCRE2 %s\n"), buf); +} + /* Match the already-compiled PCRE pattern against the data in SUBJECT, of size SEARCH_BYTES and starting with offset SEARCH_OFFSET, with options OPTIONS. @@ -104,7 +128,7 @@ { uint32_t lim; pcre2_config (PCRE2_CONFIG_DEPTHLIMIT, &lim); - if (INT_MULTIPLY_WRAPV (lim, 2, &lim)) + if (ckd_mul (&lim, lim, 2)) return e; if (!pc->mcontext) pc->mcontext = pcre2_match_context_create (pc->gcontext); @@ -115,16 +139,11 @@ } } -/* Return true if E is an error code for bad UTF-8, and if pcre2_match - could return E because PCRE lacks PCRE2_MATCH_INVALID_UTF. */ +/* Return true if E is an error code for bad UTF-8. */ static bool bad_utf8_from_pcre2 (int e) { -#ifdef PCRE2_MATCH_INVALID_UTF - return false; -#else return PCRE2_ERROR_UTF8_ERR21 <= e && e <= PCRE2_ERROR_UTF8_ERR1; -#endif } /* Compile the -P style PATTERN, containing SIZE bytes that are @@ -144,29 +163,46 @@ if (localeinfo.multibyte) { + uint32_t unicode; + if (pcre2_config (PCRE2_CONFIG_UNICODE, &unicode) < 0 || !unicode) + die (EXIT_TROUBLE, 0, + _("-P supports only unibyte locales on this platform")); if (! localeinfo.using_utf8) die (EXIT_TROUBLE, 0, _("-P supports only unibyte and UTF-8 locales")); + flags |= PCRE2_UTF; + + /* If supported, consider invalid UTF-8 as a barrier not an error. */ + flags |= MATCH_INVALID_UTF; + + /* If PCRE2_EXTRA_ASCII_BSD is available, use PCRE2_UCP + so that \d does not have the undesirable effect of matching + non-ASCII digits. Otherwise (i.e., with PCRE2 10.42 and earlier), + escapes like \w have only their ASCII interpretations, + but that's better than the confusion that would ensue if \d + matched non-ASCII digits. */ + flags |= PCRE2_EXTRA_ASCII_BSD ? PCRE2_UCP : 0; + #if 0 /* Do not match individual code units but only UTF-8. */ flags |= PCRE2_NEVER_BACKSLASH_C; #endif -#ifdef PCRE2_MATCH_INVALID_UTF - /* Consider invalid UTF-8 as a barrier, instead of error. */ - flags |= PCRE2_MATCH_INVALID_UTF; -#endif } /* FIXME: Remove this restriction. */ if (rawmemchr (pattern, '\n') != patlim) die (EXIT_TROUBLE, 0, _("the -P option only supports a single pattern")); +#ifdef PCRE2_EXTRA_MATCH_LINE + uint32_t extra_options = (PCRE2_EXTRA_ASCII_BSD + | (match_lines ? PCRE2_EXTRA_MATCH_LINE : 0)); + pcre2_set_compile_extra_options (ccontext, extra_options); +#endif + void *re_storage = NULL; if (match_lines) { -#ifdef PCRE2_EXTRA_MATCH_LINE - pcre2_set_compile_extra_options (ccontext, PCRE2_EXTRA_MATCH_LINE); -#else +#ifndef PCRE2_EXTRA_MATCH_LINE static char const /* These sizes omit trailing NUL. */ xprefix[4] = "^(?:", xsuffix[2] = ")$"; idx_t re_size = size + sizeof xprefix + sizeof xsuffix; @@ -193,7 +229,9 @@ size = re_size; } - pcre2_set_character_tables (ccontext, pcre2_maketables (gcontext)); + if (!localeinfo.multibyte) + pcre2_set_character_tables (ccontext, pcre2_maketables (gcontext)); + pc->cre = pcre2_compile ((PCRE2_SPTR) pattern, size, flags, &ec, &e, ccontext); if (!pc->cre) @@ -210,9 +248,9 @@ pc->mcontext = NULL; pc->data = pcre2_match_data_create_from_pattern (pc->cre, gcontext); - ec = pcre2_jit_compile (pc->cre, PCRE2_JIT_COMPLETE); - if (ec && ec != PCRE2_ERROR_JIT_BADOPTION && ec != PCRE2_ERROR_NOMEMORY) - die (EXIT_TROUBLE, 0, _("JIT internal error: %d"), ec); + /* Ignore any failure return from pcre2_jit_compile, as that merely + means JIT won't be used during matching. */ + pcre2_jit_compile (pc->cre, PCRE2_JIT_COMPLETE); /* The PCRE documentation says that a 32 KiB stack is the default. */ pc->jit_stack = NULL; @@ -280,7 +318,7 @@ e = jit_exec (pc, subject, line_end - subject, search_offset, options); - if (!bad_utf8_from_pcre2 (e)) + if (MATCH_INVALID_UTF || !bad_utf8_from_pcre2 (e)) break; idx_t valid_bytes = pcre2_get_startchar (pc->data); diff -ur grep-3.7-alt1/src/search.h grep-3.11-alt1/src/search.h --- grep-3.7-alt1/src/search.h 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/src/search.h 2023-04-11 03:20:47.000000000 +0300 @@ -1,5 +1,5 @@ /* search.c - searching subroutines using dfa, kwset and regex for grep. - Copyright 1992, 1998, 2000, 2007, 2009-2022 Free Software Foundation, Inc. + Copyright 1992, 1998, 2000, 2007, 2009-2023 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -65,6 +65,7 @@ /* pcresearch.c */ extern void *Pcompile (char *, idx_t, reg_syntax_t, bool); extern ptrdiff_t Pexecute (void *, char const *, idx_t, idx_t *, char const *); +extern void Pprint_version (void); /* grep.c */ extern struct localeinfo localeinfo; diff -ur grep-3.7-alt1/src/searchutils.c grep-3.11-alt1/src/searchutils.c --- grep-3.7-alt1/src/searchutils.c 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/src/searchutils.c 2023-01-02 07:36:23.000000000 +0300 @@ -1,5 +1,5 @@ /* searchutils.c - helper subroutines for grep's matchers. - Copyright 1992, 1998, 2000, 2007, 2009-2022 Free Software Foundation, Inc. + Copyright 1992, 1998, 2000, 2007, 2009-2023 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/src/system.h grep-3.11-alt1/src/system.h --- grep-3.7-alt1/src/system.h 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/src/system.h 2023-01-02 07:36:23.000000000 +0300 @@ -1,5 +1,5 @@ /* Portability cruft. Include after config.h and sys/types.h. - Copyright 1996, 1998-2000, 2007, 2009-2022 Free Software Foundation, Inc. + Copyright 1996, 1998-2000, 2007, 2009-2023 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by Только в grep-3.11-alt1: .tarball-version diff -ur grep-3.7-alt1/tests/backref grep-3.11-alt1/tests/backref --- grep-3.7-alt1/tests/backref 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/backref 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Test for back-references and other things. # -# Copyright (C) 2001, 2006, 2009-2022 Free Software Foundation, Inc. +# Copyright (C) 2001, 2006, 2009-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright @@ -43,4 +43,12 @@ failures=1 fi +# https://bugs.gnu.org/36148#13 +echo 'Total failed: 2 (1 ignored)' | + grep -e '^Total failed: 0$' -e '^Total failed: \([0-9]*\) (\1 ignored)$' +if test $? -ne 1 ; then + echo "Backref: Multiple -e test, test #5 failed" + failures=1 +fi + Exit $failures diff -ur grep-3.7-alt1/tests/backref-alt grep-3.11-alt1/tests/backref-alt --- grep-3.7-alt1/tests/backref-alt 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/backref-alt 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Test for a bug in glibc's regex code as of 2015-09-19. # -# Copyright 2015-2022 Free Software Foundation, Inc. +# Copyright 2015-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/backslash-dot grep-3.11-alt1/tests/backslash-dot --- grep-3.7-alt1/tests/backslash-dot 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/backslash-dot 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # This once failed to match: echo . | grep '\.' # -# Copyright (C) 2020-2022 Free Software Foundation, Inc. +# Copyright (C) 2020-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/backslash-s-and-repetition-operators grep-3.11-alt1/tests/backslash-s-and-repetition-operators --- grep-3.7-alt1/tests/backslash-s-and-repetition-operators 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/backslash-s-and-repetition-operators 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Ensure that \s and \S work with repetition operators. # -# Copyright (C) 2013-2022 Free Software Foundation, Inc. +# Copyright (C) 2013-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/backslash-s-vs-invalid-multibyte grep-3.11-alt1/tests/backslash-s-vs-invalid-multibyte --- grep-3.7-alt1/tests/backslash-s-vs-invalid-multibyte 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/backslash-s-vs-invalid-multibyte 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Ensure that neither \s nor \S matches an invalid multibyte character. # -# Copyright (C) 2013-2022 Free Software Foundation, Inc. +# Copyright (C) 2013-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/big-hole grep-3.11-alt1/tests/big-hole --- grep-3.7-alt1/tests/big-hole 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/big-hole 2022-05-22 19:00:33.000000000 +0300 @@ -4,6 +4,7 @@ . "${srcdir=.}/init.sh"; path_prepend_ ../src expensive_ +require_perl_ # Skip this test if there is no usable SEEK_HOLE support, # as is the case with linux-3.5.0 on ext4 and tmpfs file systems. diff -ur grep-3.7-alt1/tests/binary-file-matches grep-3.11-alt1/tests/binary-file-matches --- grep-3.7-alt1/tests/binary-file-matches 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/binary-file-matches 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Test for the "binary file ... matches" diagnostic. # -# Copyright (C) 2020-2022 Free Software Foundation, Inc. +# Copyright (C) 2020-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/bre grep-3.11-alt1/tests/bre --- grep-3.7-alt1/tests/bre 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/bre 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Regression test for GNU grep. # -# Copyright (C) 2001, 2006, 2009-2022 Free Software Foundation, Inc. +# Copyright (C) 2001, 2006, 2009-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/bre.awk grep-3.11-alt1/tests/bre.awk --- grep-3.7-alt1/tests/bre.awk 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/bre.awk 2023-01-02 07:36:23.000000000 +0300 @@ -1,4 +1,4 @@ -# Copyright (C) 2001, 2006, 2009-2022 Free Software Foundation, Inc. +# Copyright (C) 2001, 2006, 2009-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/case-fold-titlecase grep-3.11-alt1/tests/case-fold-titlecase --- grep-3.7-alt1/tests/case-fold-titlecase 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/case-fold-titlecase 2023-01-16 04:39:41.000000000 +0300 @@ -1,7 +1,7 @@ #!/bin/sh # Check that case folding works even with titlecase and similarly odd chars. -# Copyright 2014-2022 Free Software Foundation, Inc. +# Copyright 2014-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -168,7 +168,7 @@ done # Try a unibyte test with ISO 8859-7, if available. -if test "$(get-mb-cur-max el_GR.iso88597)" -eq 1; then +if test "$(get-mb-cur-max el_GR.iso88597)" = 1; then LC_ALL=el_GR.iso88597 export LC_ALL diff -ur grep-3.7-alt1/tests/c-locale grep-3.11-alt1/tests/c-locale --- grep-3.7-alt1/tests/c-locale 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/c-locale 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Regression test for GNU grep. # -# Copyright 2016-2022 Free Software Foundation, Inc. +# Copyright 2016-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright Только в grep-3.11-alt1/tests: color-colors diff -ur grep-3.7-alt1/tests/Coreutils.pm grep-3.11-alt1/tests/Coreutils.pm --- grep-3.7-alt1/tests/Coreutils.pm 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/Coreutils.pm 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ package Coreutils; # This is a testing framework. -# Copyright (C) 1998-2015, 2017-2022 Free Software Foundation, Inc. +# Copyright (C) 1998-2015, 2017-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/count-newline grep-3.11-alt1/tests/count-newline --- grep-3.7-alt1/tests/count-newline 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/count-newline 2023-01-02 07:36:23.000000000 +0300 @@ -2,7 +2,7 @@ # Test that newline is counted correctly even when the transition # table is rebuilt. -# Copyright 2014-2022 Free Software Foundation, Inc. +# Copyright 2014-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/CuSkip.pm grep-3.11-alt1/tests/CuSkip.pm --- grep-3.7-alt1/tests/CuSkip.pm 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/CuSkip.pm 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ package CuSkip; # Skip a test: emit diag to log and to stderr, and exit 77 -# Copyright (C) 2011-2015, 2017-2022 Free Software Foundation, Inc. +# Copyright (C) 2011-2015, 2017-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/CuTmpdir.pm grep-3.11-alt1/tests/CuTmpdir.pm --- grep-3.7-alt1/tests/CuTmpdir.pm 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/CuTmpdir.pm 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ package CuTmpdir; # create, then chdir into a temporary sub-directory -# Copyright (C) 2007-2015, 2017-2022 Free Software Foundation, Inc. +# Copyright (C) 2007-2015, 2017-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/dfa-coverage grep-3.11-alt1/tests/dfa-coverage --- grep-3.7-alt1/tests/dfa-coverage 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/dfa-coverage 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #!/bin/sh # Exercise the final reachable code in dfa.c's match_mb_charset. -# Copyright (C) 2012-2022 Free Software Foundation, Inc. +# Copyright (C) 2012-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/dfa-heap-overrun grep-3.11-alt1/tests/dfa-heap-overrun --- grep-3.7-alt1/tests/dfa-heap-overrun 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/dfa-heap-overrun 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #!/bin/sh # Trigger a heap overrun in grep-2.6..grep-2.8. -# Copyright (C) 2011-2022 Free Software Foundation, Inc. +# Copyright (C) 2011-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/dfa-invalid-utf8 grep-3.11-alt1/tests/dfa-invalid-utf8 --- grep-3.7-alt1/tests/dfa-invalid-utf8 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/dfa-invalid-utf8 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Test whether "grep '.'" matches invalid UTF-8 byte sequences. # -# Copyright 2019-2022 Free Software Foundation, Inc. +# Copyright 2019-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/empty grep-3.11-alt1/tests/empty --- grep-3.7-alt1/tests/empty 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/empty 2023-01-02 07:36:23.000000000 +0300 @@ -2,7 +2,7 @@ # test that the empty file means no pattern # and an empty pattern means match all. # -# Copyright (C) 2001, 2006, 2009-2022 Free Software Foundation, Inc. +# Copyright (C) 2001, 2006, 2009-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/empty-line-mb grep-3.11-alt1/tests/empty-line-mb --- grep-3.7-alt1/tests/empty-line-mb 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/empty-line-mb 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Exercise bugs in grep-2.13 with -i, -n and an RE of ^$ in a multi-byte locale. # -# Copyright (C) 2012-2022 Free Software Foundation, Inc. +# Copyright (C) 2012-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/encoding-error grep-3.11-alt1/tests/encoding-error --- grep-3.7-alt1/tests/encoding-error 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/encoding-error 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Test grep's behavior on encoding errors. # -# Copyright 2015-2022 Free Software Foundation, Inc. +# Copyright 2015-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/envvar-check grep-3.11-alt1/tests/envvar-check --- grep-3.7-alt1/tests/envvar-check 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/envvar-check 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ # -*- sh -*- # Check environment variables for sane values while testing. -# Copyright (C) 2000-2022 Free Software Foundation, Inc. +# Copyright (C) 2000-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/ere grep-3.11-alt1/tests/ere --- grep-3.7-alt1/tests/ere 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/ere 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Regression test for GNU grep. # -# Copyright (C) 2001, 2006, 2009-2022 Free Software Foundation, Inc. +# Copyright (C) 2001, 2006, 2009-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/ere.awk grep-3.11-alt1/tests/ere.awk --- grep-3.7-alt1/tests/ere.awk 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/ere.awk 2023-01-02 07:36:23.000000000 +0300 @@ -1,4 +1,4 @@ -# Copyright (C) 2001, 2006, 2009-2022 Free Software Foundation, Inc. +# Copyright (C) 2001, 2006, 2009-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/false-match-mb-non-utf8 grep-3.11-alt1/tests/false-match-mb-non-utf8 --- grep-3.7-alt1/tests/false-match-mb-non-utf8 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/false-match-mb-non-utf8 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Test for false matches in grep 2.19..2.26 in multibyte, non-UTF8 locales # -# Copyright (C) 2016-2022 Free Software Foundation, Inc. +# Copyright (C) 2016-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/fgrep-longest grep-3.11-alt1/tests/fgrep-longest --- grep-3.7-alt1/tests/fgrep-longest 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/fgrep-longest 2023-01-02 07:36:23.000000000 +0300 @@ -2,7 +2,7 @@ # With multiple matches, grep -Fo could print a shorter one. # This bug affected grep versions 2.26 through 2.27. # -# Copyright (C) 2017-2022 Free Software Foundation, Inc. +# Copyright (C) 2017-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/file grep-3.11-alt1/tests/file --- grep-3.7-alt1/tests/file 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/file 2023-01-02 07:36:23.000000000 +0300 @@ -4,7 +4,7 @@ # grep -F -f pattern_file file # grep -G -f pattern_file file # -# Copyright (C) 2001, 2006, 2009-2022 Free Software Foundation, Inc. +# Copyright (C) 2001, 2006, 2009-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/filename-lineno.pl grep-3.11-alt1/tests/filename-lineno.pl --- grep-3.7-alt1/tests/filename-lineno.pl 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/filename-lineno.pl 2023-01-02 07:36:23.000000000 +0300 @@ -4,7 +4,7 @@ # file or line number from which the offending regular expression came. # With 2.26, now, each such diagnostic has a "FILENAME:LINENO: " prefix. -# Copyright (C) 2016-2022 Free Software Foundation, Inc. +# Copyright (C) 2016-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/fmbtest grep-3.11-alt1/tests/fmbtest --- grep-3.7-alt1/tests/fmbtest 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/fmbtest 2023-03-05 01:12:25.000000000 +0300 @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2001, 2006, 2009-2022 Free Software Foundation, Inc. +# Copyright (C) 2001, 2006, 2009-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright @@ -53,21 +53,21 @@ for mode in F G E; do test1=$(echo $(LC_ALL=$cz grep -${mode} -f cspatfile csinput | - tr -cs '0-9' '[ *]')) + tr '\n' ' ' | tr -cd '0-9 ')) if test "$test1" != "11 12 13 14 15 16 17 18"; then echo "Test #1 ${mode} failed: $test1" failures=1 fi test2=$(echo $(LC_ALL=$cz grep -${mode}i -f cspatfile csinput | - tr -cs '0-9' '[ *]')) + tr '\n' ' ' | tr -cd '0-9 ')) if test "$test2" != "01 02 07 08 10 11 12 13 14 15 16 17 18 19 20"; then echo "Test #2 ${mode} failed: $test2" failures=1 fi test3=$(echo $(LC_ALL=$cz grep -${mode}i -e 'ČÍšE' -e 'Čas' csinput | - tr -cs '0-9' '[ *]')) + tr '\n' ' ' | tr -cd '0-9 ')) if test "$test3" != "01 02 07 08 10 11 12 13 14 15 16 17 18 19 20"; then echo "Test #3 ${mode} failed: $test3" failures=1 @@ -115,7 +115,7 @@ for mode in G E; do test8=$(echo $(LC_ALL=$cz grep -${mode}i -e 'Č.šE' -e 'Č[a-f]s' csinput | - tr -cs '0-9' '[ *]')) + tr '\n' ' ' | tr -cd '0-9 ')) if test "$test8" != "01 02 07 08 10 11 12 13 14 15 16 17 18 19 20"; then echo "Test #8 ${mode} failed: $test8" failures=1 diff -ur grep-3.7-alt1/tests/foad1 grep-3.11-alt1/tests/foad1 --- grep-3.7-alt1/tests/foad1 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/foad1 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Test various combinations of command-line options. # -# Copyright (C) 2001, 2006, 2009-2022 Free Software Foundation, Inc. +# Copyright (C) 2001, 2006, 2009-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/get-mb-cur-max.c grep-3.11-alt1/tests/get-mb-cur-max.c --- grep-3.7-alt1/tests/get-mb-cur-max.c 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/get-mb-cur-max.c 2023-01-23 03:29:00.000000000 +0300 @@ -1,5 +1,5 @@ /* Auxiliary program to detect support for a locale. - Copyright 2010-2022 Free Software Foundation, Inc. + Copyright 2010-2023 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,8 +21,6 @@ #include #include -#include "getprogname.h" - int main (int argc, char **argv) { Только в grep-3.11-alt1/tests: glibc-infloop Только в grep-3.11-alt1/tests: hangul-syllable diff -ur grep-3.7-alt1/tests/hash-collision-perf grep-3.11-alt1/tests/hash-collision-perf --- grep-3.7-alt1/tests/hash-collision-perf 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/hash-collision-perf 2023-01-02 07:36:23.000000000 +0300 @@ -2,7 +2,7 @@ # Test for this performance regression: # grep-3.5 and 3.6 would take O(N^2) time for some sets of input regexps. -# Copyright 2020-2022 Free Software Foundation, Inc. +# Copyright 2020-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,6 +21,8 @@ fail=0 +require_perl_ + : > empty || framework_failure_ # Construct a test case that consumes enough CPU time that we don't @@ -42,7 +44,6 @@ # Deliberately recording in an unused variable so it # shows up in set -x output, in case this test fails. ratio=$(expr "$large_ms" / "$small_ms") -warn_ ratio=$ratio # The duration of the latter run must be no more than 10 times # that of the former. Using recent versions prior to this fix, diff -ur grep-3.7-alt1/tests/help-version grep-3.11-alt1/tests/help-version --- grep-3.7-alt1/tests/help-version 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/help-version 2023-01-02 07:36:23.000000000 +0300 @@ -2,7 +2,7 @@ # Make sure all of these programs work properly # when invoked with --help or --version. -# Copyright (C) 2000-2022 Free Software Foundation, Inc. +# Copyright (C) 2000-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/high-bit-range grep-3.11-alt1/tests/high-bit-range --- grep-3.7-alt1/tests/high-bit-range 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/high-bit-range 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #!/bin/sh # Exercise high-bit-set unibyte-in-[...]-range bug. -# Copyright (C) 2011-2022 Free Software Foundation, Inc. +# Copyright (C) 2011-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/init.cfg grep-3.11-alt1/tests/init.cfg --- grep-3.7-alt1/tests/init.cfg 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/init.cfg 2023-01-14 05:27:16.000000000 +0300 @@ -48,10 +48,18 @@ require_pcre_() { - echo . | grep -P . 2>err || { - test $? -eq 1 && fail_ PCRE available, but does not work. - skip_ no PCRE support - } + case $LC_ALL in + *.UTF-8) + printf '\303\241\n' | grep -P '^.$' 2>err || { + test $? -eq 1 && fail_ PCRE available, but does not work + skip_ no PCRE Unicode support + };; + *) + echo . | grep -P '^.$' 2>err || { + test $? -eq 1 && fail_ PCRE available, but does not work. + skip_ no PCRE support + };; + esac compare /dev/null err || fail_ PCRE available, but stderr not empty. } @@ -138,6 +146,13 @@ skip_ "$locale locale not found" } +# Skip the current test if we lack Perl. +require_perl_() +{ + test "$PERL" && $PERL -e 'use warnings' > /dev/null 2>&1 \ + || skip_ 'configure did not find a usable version of Perl' +} + expensive_() { if test "$RUN_EXPENSIVE_TESTS" != yes; then diff -ur grep-3.7-alt1/tests/initial-tab grep-3.11-alt1/tests/initial-tab --- grep-3.7-alt1/tests/initial-tab 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/initial-tab 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #!/bin/sh # Exercise -T. -# Copyright 2016-2022 Free Software Foundation, Inc. +# Copyright 2016-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/init.sh grep-3.11-alt1/tests/init.sh --- grep-3.7-alt1/tests/init.sh 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/init.sh 2023-01-16 04:39:41.000000000 +0300 @@ -1,6 +1,6 @@ # source this file; set up for tests -# Copyright (C) 2009-2022 Free Software Foundation, Inc. +# Copyright (C) 2009-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -271,12 +271,10 @@ # # First, try to use the mktemp program. # Failing that, we'll roll our own mktemp-like function: -# - try to get random bytes from /dev/urandom +# - try to get random bytes from /dev/urandom, mapping them to file-name bytes # - failing that, generate output from a combination of quickly-varying -# sources and gzip. Ignore non-varying gzip header, and extract -# "random" bits from there. -# - given those bits, map to file-name bytes using tr, and try to create -# the desired directory. +# sources and awk. +# - try to create the desired directory. # - make only $MAX_TRIES_ attempts # Helper function. Print $N pseudo-random bytes from a-zA-Z0-9. @@ -296,20 +294,27 @@ return fi - n_plus_50_=`expr $n_ + 50` - cmds_='date; date +%N; free; who -a; w; ps auxww; ps -ef' - data_=` (eval "$cmds_") 2>&1 | gzip ` + # Fall back on quickly-varying sources + awk. + # Limit awk program to 7th Edition Unix so that it works even on Solaris 10. - # Ensure that $data_ has length at least 50+$n_ - while :; do - len_=`echo "$data_"|wc -c` - test $n_plus_50_ -le $len_ && break; - data_=` (echo "$data_"; eval "$cmds_") 2>&1 | gzip ` - done - - echo "$data_" \ - | dd bs=1 skip=50 count=$n_ 2>/dev/null \ - | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_ + (date; date +%N; free; who -a; w; ps auxww; ps -ef) 2>&1 | awk ' + BEGIN { + n = '"$n_"' + for (i = 0; i < 256; i++) + ordinal[sprintf ("%c", i)] = i + } + { + for (i = 1; i <= length; i++) + a[ai++ % n] += ordinal[substr ($0, i, 1)] + } + END { + chars = "'"$chars_"'" + charslen = length (chars) + for (i = 0; i < n; i++) + printf "%s", substr (chars, a[i] % charslen + 1, 1) + printf "\n" + } + ' } mktempd_ () @@ -641,18 +646,19 @@ for diff_opt_ in -u -U3 -c '' no; do test "$diff_opt_" != no && - diff_out_=`exec 2>/dev/null; diff $diff_opt_ "$0" "$0" < /dev/null` && + diff_out_=`exec 2>/dev/null + LC_ALL=C diff $diff_opt_ "$0" "$0" < /dev/null` && break done if test "$diff_opt_" != no; then if test -z "$diff_out_"; then - compare_ () { diff $diff_opt_ "$@"; } + compare_ () { LC_ALL=C diff $diff_opt_ "$@"; } else compare_ () { # If no differences were found, AIX and HP-UX 'diff' produce output # like "No differences encountered". Hide this output. - diff $diff_opt_ "$@" > diff.out + LC_ALL=C diff $diff_opt_ "$@" > diff.out diff_status_=$? test $diff_status_ -eq 0 || cat diff.out || diff_status_=2 rm -f diff.out || diff_status_=2 @@ -697,4 +703,4 @@ setup_ "$@" # This trap is here, rather than in the setup_ function, because some # shells run the exit trap at shell function exit, rather than script exit. -trap remove_tmp_ 0 +trap remove_tmp_ EXIT diff -ur grep-3.7-alt1/tests/khadafy grep-3.11-alt1/tests/khadafy --- grep-3.7-alt1/tests/khadafy 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/khadafy 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Regression test for GNU grep. # -# Copyright (C) 2001, 2006, 2009-2022 Free Software Foundation, Inc. +# Copyright (C) 2001, 2006, 2009-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/kwset-abuse grep-3.11-alt1/tests/kwset-abuse --- grep-3.7-alt1/tests/kwset-abuse 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/kwset-abuse 2023-01-02 07:36:23.000000000 +0300 @@ -2,7 +2,7 @@ # Evoke a segfault in a hard-to-reach code path of kwset.c. # This bug affected grep versions 2.19 through 2.21. # -# Copyright (C) 2015-2022 Free Software Foundation, Inc. +# Copyright (C) 2015-2023 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/long-pattern-perf grep-3.11-alt1/tests/long-pattern-perf --- grep-3.7-alt1/tests/long-pattern-perf 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/long-pattern-perf 2023-01-20 21:04:06.000000000 +0300 @@ -1,7 +1,7 @@ #!/bin/sh # grep-2.21 would incur a 100x penalty for 10x increase in regexp length -# Copyright 2015-2022 Free Software Foundation, Inc. +# Copyright 2015-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,6 +24,7 @@ # system load during the two test runs, so we'll mark it as # "expensive", making it less likely to be run by regular users. expensive_ +require_perl_ echo x > in || framework_failure_ # Note that we want 10x the byte count (not line count) in the larger file. @@ -31,8 +32,22 @@ cat r r r r r r r r r r > re-10x || framework_failure_ mv r re || framework_failure_ -base_ms=$(user_time_ 1 grep -f re in ) || fail=1 -b10x_ms=$(user_time_ 1 grep -f re-10x in) || fail=1 +returns_ 0 user_time_ 1 grep -f re in > base-ms \ + || framework_failure_ 'failed to compute baseline timing' +base_ms=$(cat base-ms) + +# This test caused trouble on at least two types of fringe hosts: those +# with very little memory (a 1.5GB RAM Solaris host) and a Linux/s390x +# (emulated with qemu-system-s390x). The former became unusable due to +# mem requirements of the 2nd test, and the latter ended up taking >35x +# more time than the base case. Skipping this test for any system using +# more than this many milliseconds for the first case should avoid those +# false-positive failures while skipping the test on few other systems. +test 800 -lt "$base_ms" && skip_ "this base-case test took too long" + +returns_ 0 user_time_ 1 grep -f re-10x in > b10x-ms \ + || framework_failure_ 'failed to compute 10x timing' +b10x_ms=$(cat b10x-ms) # Increasing the length of the regular expression by a factor # of 10 should cause no more than a 10x increase in duration. diff -ur grep-3.7-alt1/tests/Makefile.am grep-3.11-alt1/tests/Makefile.am --- grep-3.7-alt1/tests/Makefile.am 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/Makefile.am 2023-04-30 10:01:41.000000000 +0300 @@ -1,5 +1,5 @@ ## Process this file with automake to create Makefile.in -# Copyright 1997-1998, 2005-2022 Free Software Foundation, Inc. +# Copyright 1997-1998, 2005-2023 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -46,13 +46,19 @@ # The triple-backref test is expected to fail with both the system # matcher (i.e., with glibc) and with the included matcher. # Both matchers need to be fixed. -# FIXME-2015: Remove this once the glibc and gnulib bugs are fixed. +# FIXME-2025: Remove this once the glibc and gnulib bugs are fixed. XFAIL_TESTS = triple-backref +# The glibc-infloop test is expected to fail with both the system +# matcher (i.e., with glibc) and with the included matcher. +# Both matchers need to be fixed. +# FIXME-2025: Remove this once the glibc and gnulib bugs are fixed. +XFAIL_TESTS += glibc-infloop + # Equivalence classes are only supported when using the system # matcher (which means only with glibc). # The included matcher needs to be fixed. -# FIXME-2015: Remove this once the gnulib bug is fixed. +# FIXME-2025: Remove this once the gnulib bug is fixed. if USE_INCLUDED_REGEX XFAIL_TESTS += equiv-classes else @@ -83,6 +89,7 @@ case-fold-titlecase \ char-class-multibyte \ char-class-multibyte2 \ + color-colors \ context-0 \ count-newline \ dfa-coverage \ @@ -107,9 +114,11 @@ fillbuf-long-line \ fmbtest \ foad1 \ + glibc-infloop \ grep-dev-null \ grep-dev-null-out \ grep-dir \ + hangul-syllable \ hash-collision-perf \ help-version \ high-bit-range \ @@ -137,6 +146,7 @@ options \ pcre \ pcre-abort \ + pcre-ascii-digits \ pcre-context \ pcre-count \ pcre-infloop \ @@ -145,6 +155,8 @@ pcre-jitstack \ pcre-o \ pcre-utf8 \ + pcre-utf8-bug224 \ + pcre-utf8-w \ pcre-w \ pcre-wx-backref \ pcre-z \ @@ -174,11 +186,13 @@ unibyte-bracket-expr \ unibyte-negated-circumflex \ utf8-bracket \ + version-pcre \ warn-char-classes \ word-delim-multibyte \ word-multi-file \ word-multibyte \ write-error-msg \ + y2038-vs-32-bit \ yesno \ z-anchor-newline @@ -249,6 +263,7 @@ srcdir='$(srcdir)' \ top_srcdir='$(top_srcdir)' \ CC='$(CC)' \ + CONFIG_HEADER='$(abs_top_builddir)/$(CONFIG_INCLUDE)' \ GREP_TEST_NAME=`echo $$tst|sed 's,^\./,,;s,/,-,g'` \ MAKE=$(MAKE) \ MALLOC_PERTURB_=$(MALLOC_PERTURB_) \ Только в grep-3.11-alt1/tests: Makefile.in diff -ur grep-3.7-alt1/tests/many-regex-performance grep-3.11-alt1/tests/many-regex-performance --- grep-3.7-alt1/tests/many-regex-performance 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/many-regex-performance 2023-01-02 07:36:23.000000000 +0300 @@ -3,7 +3,7 @@ # grep-3.4 would require O(N^2) RSS for N regexps # grep-3.5 requires O(N) in the most common cases. -# Copyright 2020-2022 Free Software Foundation, Inc. +# Copyright 2020-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,15 +26,16 @@ # system load during the two test runs, so we'll mark it as # "expensive", making it less likely to be run by regular users. expensive_ +require_perl_ # Make the quick/small input large enough so that even on high-end # systems this first invocation takes at least 10ms of user time. word_list=/usr/share/dict/linux.words -# If $word_list does not exist, generate an input that exibhits +# If $word_list does not exist, generate an input that exhibits # similar performance characteristics. if ! test -f $word_list; then - # Generate data comprable to that word list. + # Generate data comparable to that word list. # Note how all "words" start with "a", and that there is # a small percentage of lines with at least one "." metachar. # This requires /dev/urandom, so if it's not present, skip diff -ur grep-3.7-alt1/tests/match-lines grep-3.11-alt1/tests/match-lines --- grep-3.7-alt1/tests/match-lines 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/match-lines 2023-01-02 07:36:23.000000000 +0300 @@ -3,7 +3,7 @@ # grep -F -x -o PAT print an extra newline for each match. # This would fail for grep-2.19 and grep-2.20. -# Copyright 2014-2022 Free Software Foundation, Inc. +# Copyright 2014-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/mb-dot-newline grep-3.11-alt1/tests/mb-dot-newline --- grep-3.7-alt1/tests/mb-dot-newline 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/mb-dot-newline 2023-01-02 07:36:23.000000000 +0300 @@ -2,7 +2,7 @@ # Trigger a bug in the DFA matcher. # This would fail for grep-2.20. -# Copyright 2014-2022 Free Software Foundation, Inc. +# Copyright 2014-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/mb-non-UTF8-overrun grep-3.11-alt1/tests/mb-non-UTF8-overrun --- grep-3.7-alt1/tests/mb-non-UTF8-overrun 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/mb-non-UTF8-overrun 2023-01-02 07:36:23.000000000 +0300 @@ -2,7 +2,7 @@ # grep would sometimes read beyond end of input, when using a non-UTF8 # multibyte locale. -# Copyright 2014-2022 Free Software Foundation, Inc. +# Copyright 2014-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/mb-non-UTF8-perf-Fw grep-3.11-alt1/tests/mb-non-UTF8-perf-Fw --- grep-3.7-alt1/tests/mb-non-UTF8-perf-Fw 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/mb-non-UTF8-perf-Fw 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #!/bin/sh # Test for a performance regression with -Fw and a non-UTF8 multibyte locale. -# Copyright 2019-2022 Free Software Foundation, Inc. +# Copyright 2019-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/mb-non-UTF8-performance grep-3.11-alt1/tests/mb-non-UTF8-performance --- grep-3.7-alt1/tests/mb-non-UTF8-performance 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/mb-non-UTF8-performance 2023-01-02 07:36:23.000000000 +0300 @@ -3,7 +3,7 @@ # The 200x is on an Intel i7-based system. # On an AMD FX-4100, it would take up to 2500x longer. -# Copyright 2014-2022 Free Software Foundation, Inc. +# Copyright 2014-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,6 +26,7 @@ # system load during the two test runs, so we'll mark it as # "expensive", making it less likely to be run by regular users. expensive_ +require_perl_ # Make the input large enough so that even on high-end systems # the unibyte test takes at least 10ms of user time. diff -ur grep-3.7-alt1/tests/mb-non-UTF8-word-boundary grep-3.11-alt1/tests/mb-non-UTF8-word-boundary --- grep-3.7-alt1/tests/mb-non-UTF8-word-boundary 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/mb-non-UTF8-word-boundary 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #!/bin/sh # grep -Fw could false-match when using a non-UTF8 multibyte locale. -# Copyright 2019-2022 Free Software Foundation, Inc. +# Copyright 2019-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/multibyte-white-space grep-3.11-alt1/tests/multibyte-white-space --- grep-3.7-alt1/tests/multibyte-white-space 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/multibyte-white-space 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Test whether \s matches SP and UTF-8 multi-byte white space characters. # -# Copyright (C) 2013-2022 Free Software Foundation, Inc. +# Copyright (C) 2013-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/multiple-begin-or-end-line grep-3.11-alt1/tests/multiple-begin-or-end-line --- grep-3.7-alt1/tests/multiple-begin-or-end-line 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/multiple-begin-or-end-line 2023-01-02 07:36:23.000000000 +0300 @@ -2,7 +2,7 @@ # Test a pattern of multiple begin or end line constraints. # This would mistakenly print a line when using grep-2.19. -# Copyright 2014-2022 Free Software Foundation, Inc. +# Copyright 2014-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/null-byte grep-3.11-alt1/tests/null-byte --- grep-3.7-alt1/tests/null-byte 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/null-byte 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #!/bin/sh # Test NUL bytes in patterns and data. -# Copyright 2014-2022 Free Software Foundation, Inc. +# Copyright 2014-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/options grep-3.11-alt1/tests/options --- grep-3.7-alt1/tests/options 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/options 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Test for POSIX options for grep # -# Copyright (C) 2001, 2006, 2009-2022 Free Software Foundation, Inc. +# Copyright (C) 2001, 2006, 2009-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/pcre grep-3.11-alt1/tests/pcre --- grep-3.7-alt1/tests/pcre 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/pcre 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Simple PCRE tests. # -# Copyright (C) 2001, 2006, 2009-2022 Free Software Foundation, Inc. +# Copyright (C) 2001, 2006, 2009-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/pcre-abort grep-3.11-alt1/tests/pcre-abort --- grep-3.7-alt1/tests/pcre-abort 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/pcre-abort 2023-01-02 07:36:23.000000000 +0300 @@ -2,7 +2,7 @@ # Show that grep handles PCRE2_ERROR_MATCHLIMIT. # In grep-2.8, it would abort. # -# Copyright (C) 2011-2022 Free Software Foundation, Inc. +# Copyright (C) 2011-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright Только в grep-3.11-alt1/tests: pcre-ascii-digits diff -ur grep-3.7-alt1/tests/pcre-count grep-3.11-alt1/tests/pcre-count --- grep-3.7-alt1/tests/pcre-count 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/pcre-count 2023-01-02 07:36:23.000000000 +0300 @@ -2,7 +2,7 @@ # grep -P / grep -Pc are inconsistent results # This bug affected grep versions 2.21 through 2.22. # -# Copyright (C) 2015-2022 Free Software Foundation, Inc. +# Copyright (C) 2015-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/pcre-infloop grep-3.11-alt1/tests/pcre-infloop --- grep-3.7-alt1/tests/pcre-infloop 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/pcre-infloop 2023-01-02 07:36:23.000000000 +0300 @@ -2,7 +2,7 @@ # With some versions of libpcre, apparently including 8.35, # the following would trigger an infinite loop in its match function. -# Copyright 2014-2022 Free Software Foundation, Inc. +# Copyright 2014-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/pcre-invalid-utf8-infloop grep-3.11-alt1/tests/pcre-invalid-utf8-infloop --- grep-3.7-alt1/tests/pcre-invalid-utf8-infloop 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/pcre-invalid-utf8-infloop 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Ensure that grep -oaP doesn't infloop for invalid multi-byte input # -# Copyright (C) 2015-2022 Free Software Foundation, Inc. +# Copyright (C) 2015-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/pcre-invalid-utf8-input grep-3.11-alt1/tests/pcre-invalid-utf8-input --- grep-3.7-alt1/tests/pcre-invalid-utf8-input 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/pcre-invalid-utf8-input 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Ensure that grep -P doesn't abort or infloop for invalid multi-byte input # -# Copyright (C) 2013-2022 Free Software Foundation, Inc. +# Copyright (C) 2013-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/pcre-jitstack grep-3.11-alt1/tests/pcre-jitstack --- grep-3.7-alt1/tests/pcre-jitstack 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/pcre-jitstack 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Grep 2.21 would report "grep: internal PCRE error: -27" # -# Copyright 2015-2022 Free Software Foundation, Inc. +# Copyright 2015-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/pcre-o grep-3.11-alt1/tests/pcre-o --- grep-3.7-alt1/tests/pcre-o 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/pcre-o 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Ensure that grep -oP doesn't cause internal error at match. # -# Copyright (C) 2014-2022 Free Software Foundation, Inc. +# Copyright (C) 2014-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/pcre-utf8 grep-3.11-alt1/tests/pcre-utf8 --- grep-3.7-alt1/tests/pcre-utf8 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/pcre-utf8 2023-01-11 21:24:09.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Ensure that, with -P, Unicode \p{} symbols are correctly matched. # -# Copyright (C) 2012-2022 Free Software Foundation, Inc. +# Copyright (C) 2012-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright @@ -14,7 +14,7 @@ fail=0 echo '$' | LC_ALL=en_US.UTF-8 grep -qP '\p{S}' \ - || skip_ 'PCRE support is compiled out, or it does not support properties' + || skip_ 'PCRE unicode support is compiled out' euro='\342\202\254 euro' printf "$euro\\n" > in || framework_failure_ Только в grep-3.11-alt1/tests: pcre-utf8-bug224 Только в grep-3.11-alt1/tests: pcre-utf8-w diff -ur grep-3.7-alt1/tests/pcre-w grep-3.11-alt1/tests/pcre-w --- grep-3.7-alt1/tests/pcre-w 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/pcre-w 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Before grep-2.19, grep -Pw %% would match %% enclosed in word boundaries # -# Copyright (C) 2014-2022 Free Software Foundation, Inc. +# Copyright (C) 2014-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/pcre-wx-backref grep-3.11-alt1/tests/pcre-wx-backref --- grep-3.7-alt1/tests/pcre-wx-backref 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/pcre-wx-backref 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Before grep-2.19, grep -P and -w/-x would not work with a back-reference. # -# Copyright (C) 2014-2022 Free Software Foundation, Inc. +# Copyright (C) 2014-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/posix-bracket grep-3.11-alt1/tests/posix-bracket --- grep-3.7-alt1/tests/posix-bracket 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/posix-bracket 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #!/bin/sh # Check various bracket expressions in the POSIX locale. -# Copyright 2014-2022 Free Software Foundation, Inc. +# Copyright 2014-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/proc grep-3.11-alt1/tests/proc --- grep-3.7-alt1/tests/proc 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/proc 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Test the /proc file system if available. -# Copyright 2016-2022 Free Software Foundation, Inc. +# Copyright 2016-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/skip-read grep-3.11-alt1/tests/skip-read --- grep-3.7-alt1/tests/skip-read 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/skip-read 2023-01-16 04:39:41.000000000 +0300 @@ -9,12 +9,10 @@ for opts in '-m0 y' '-f /dev/null' '-v ""'; do for matcher in '' -E -F; do - for file in /dev/null no-such-file; do - eval returns_ 1 grep $opts $matcher no-such-file > out || fail=1 - compare /dev/null out || fail=1 - eval returns_ 1 grep -l $opts $matcher /dev/null > out || fail=1 - compare /dev/null out || fail=1 - done + eval returns_ 1 grep $opts $matcher no-such-file > out || fail=1 + compare /dev/null out || fail=1 + eval returns_ 1 grep -l $opts $matcher /dev/null > out || fail=1 + compare /dev/null out || fail=1 eval returns_ 1 grep -L $opts $matcher /dev/null > out || fail=1 compare exp out || fail=1 eval returns_ 1 grep -L $opts $matcher /dev/null > /dev/null || fail=1 diff -ur grep-3.7-alt1/tests/spencer1 grep-3.11-alt1/tests/spencer1 --- grep-3.7-alt1/tests/spencer1 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/spencer1 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Regression test for GNU grep. # Copyright (C) 1988 Henry Spencer. -# Copyright (C) 2009-2022 Free Software Foundation, Inc. +# Copyright (C) 2009-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/spencer1.awk grep-3.11-alt1/tests/spencer1.awk --- grep-3.7-alt1/tests/spencer1.awk 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/spencer1.awk 2023-01-02 07:36:23.000000000 +0300 @@ -1,5 +1,5 @@ # Copyright (C) 1988 Henry Spencer. -# Copyright (C) 2009-2022 Free Software Foundation, Inc. +# Copyright (C) 2009-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/spencer1-locale grep-3.11-alt1/tests/spencer1-locale --- grep-3.7-alt1/tests/spencer1-locale 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/spencer1-locale 2023-01-02 07:36:23.000000000 +0300 @@ -2,7 +2,7 @@ # Regression test for GNU grep. # # Copyright (C) 1988 Henry Spencer. -# Copyright (C) 2009-2022 Free Software Foundation, Inc. +# Copyright (C) 2009-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/spencer1-locale.awk grep-3.11-alt1/tests/spencer1-locale.awk --- grep-3.7-alt1/tests/spencer1-locale.awk 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/spencer1-locale.awk 2023-01-02 07:36:23.000000000 +0300 @@ -1,5 +1,5 @@ # Copyright (C) 1988 Henry Spencer. -# Copyright (C) 2009-2022 Free Software Foundation, Inc. +# Copyright (C) 2009-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/spencer1.tests grep-3.11-alt1/tests/spencer1.tests --- grep-3.7-alt1/tests/spencer1.tests 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/spencer1.tests 2022-05-21 21:41:34.000000000 +0300 @@ -58,7 +58,9 @@ 0@a\(b@a(b 0@a\(*b@ab 0@a\(*b@a((b -1@a\x@a\x +0@a\\x@a\x +0@a[\]x@a\x +1@ax@a\x 1@abc)@- 2@(abc@- 0@((a))@abc Только в grep-3.7-alt1/tests: spencer2 Только в grep-3.7-alt1/tests: spencer2.tests diff -ur grep-3.7-alt1/tests/status grep-3.11-alt1/tests/status --- grep-3.7-alt1/tests/status 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/status 2023-01-02 07:36:23.000000000 +0300 @@ -5,7 +5,7 @@ # 1 no match # 2 file not found # -# Copyright (C) 2001, 2006, 2009-2022 Free Software Foundation, Inc. +# Copyright (C) 2001, 2006, 2009-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/surrogate-pair grep-3.11-alt1/tests/surrogate-pair --- grep-3.7-alt1/tests/surrogate-pair 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/surrogate-pair 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #!/bin/sh # Check the handling of characters outside the Unicode BMP. -# Copyright (C) 2013-2022 Free Software Foundation, Inc. +# Copyright (C) 2013-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/surrogate-search grep-3.11-alt1/tests/surrogate-search --- grep-3.7-alt1/tests/surrogate-search 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/surrogate-search 2023-01-16 04:39:41.000000000 +0300 @@ -1,7 +1,7 @@ #!/bin/sh # Check characters outside the Unicode BMP in the search string. -# Copyright 2021-2022 Free Software Foundation, Inc. +# Copyright 2021-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,15 +28,20 @@ fail=0 -s_pair=$(printf '\360\220\220\205') -printf '%s\n' "$s_pair" > in || framework_failure_ - LC_ALL=en_US.UTF-8 export LC_ALL +# On platforms like 32-bit AIX where WCHAR_MAX == 0xFFFF, skip this check, +# since the corresponding Unicode characters are not supported. +printf '\360\220\200\200\n' >in || framework_failure_ +grep '^.$' in >out || fail=1 +compare in out || skip_ 'platform does not support U+10000' + +printf '\360\220\220\205\n' > in || framework_failure_ + for opt in '' -i -E -F -iE -iF; do grep --file=in $opt in > out 2>&1 || fail=1 - compare out in || fail=1 + compare in out || fail=1 done Exit $fail diff -ur grep-3.7-alt1/tests/symlink grep-3.11-alt1/tests/symlink --- grep-3.7-alt1/tests/symlink 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/symlink 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #!/bin/sh # Check that "grep -r" does the right thing with symbolic links. -# Copyright (C) 2012-2022 Free Software Foundation, Inc. +# Copyright (C) 2012-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by Только в grep-3.7-alt1/tests: tests diff -ur grep-3.7-alt1/tests/triple-backref grep-3.11-alt1/tests/triple-backref --- grep-3.7-alt1/tests/triple-backref 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/triple-backref 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Test for a bug in glibc's regex code as of September 7, 2014. # -# Copyright (C) 2014-2022 Free Software Foundation, Inc. +# Copyright (C) 2014-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright @@ -24,6 +24,7 @@ warn_ "$ME_: expect malfunction on glibc systems due to" \ "https://sourceware.org/bugzilla/show_bug.cgi?id=11053" +# While with glibc-2.35, it no longer aborts, the empty result is still wrong: timeout 10 grep -E '(.?)(.?)(.?)\3\2\1' in > out || fail=1 compare out in || fail=1 diff -ur grep-3.7-alt1/tests/turkish-eyes grep-3.11-alt1/tests/turkish-eyes --- grep-3.7-alt1/tests/turkish-eyes 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/turkish-eyes 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #!/bin/sh # Ensure that case-insensitive matching works with all Turkish i's -# Copyright (C) 2014-2022 Free Software Foundation, Inc. +# Copyright (C) 2014-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/turkish-I grep-3.11-alt1/tests/turkish-I --- grep-3.7-alt1/tests/turkish-I 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/turkish-I 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #!/bin/sh # grep -i in UTF-8: missing NL in output on line containing I WITH DOT (U+0130) -# Copyright (C) 2011-2022 Free Software Foundation, Inc. +# Copyright (C) 2011-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/turkish-I-without-dot grep-3.11-alt1/tests/turkish-I-without-dot --- grep-3.7-alt1/tests/turkish-I-without-dot 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/turkish-I-without-dot 2023-01-02 07:36:23.000000000 +0300 @@ -3,7 +3,7 @@ # (like "I" in the tr_TR.utf8 locale) whose lower-case representation # occupies more bytes (two in this case, for 0xc4b1, aka U+0131). -# Copyright (C) 2011-2022 Free Software Foundation, Inc. +# Copyright (C) 2011-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/two-chars grep-3.11-alt1/tests/two-chars --- grep-3.7-alt1/tests/two-chars 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/two-chars 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Check for grep -F with two patterns consisting of the same char. # -# Copyright 2016-2022 Free Software Foundation, Inc. +# Copyright 2016-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/two-files grep-3.11-alt1/tests/two-files --- grep-3.7-alt1/tests/two-files 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/two-files 2023-01-02 07:36:23.000000000 +0300 @@ -2,7 +2,7 @@ # Read two files, of increasing size. # With ASAN, this would have triggered a false-positive read of poisoned memory. # -# Copyright 2015-2022 Free Software Foundation, Inc. +# Copyright 2015-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/unibyte-binary grep-3.11-alt1/tests/unibyte-binary --- grep-3.7-alt1/tests/unibyte-binary 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/unibyte-binary 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #!/bin/sh # Test binary files in unibyte locales with encoding errors -# Copyright 2016-2022 Free Software Foundation, Inc. +# Copyright 2016-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/unibyte-bracket-expr grep-3.11-alt1/tests/unibyte-bracket-expr --- grep-3.7-alt1/tests/unibyte-bracket-expr 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/unibyte-bracket-expr 2023-01-02 07:36:23.000000000 +0300 @@ -5,7 +5,7 @@ # ru_RU.KOI8-R for any C whose wide-char representation differed from # its single-byte equivalent. -# Copyright (C) 2011-2022 Free Software Foundation, Inc. +# Copyright (C) 2011-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/unibyte-negated-circumflex grep-3.11-alt1/tests/unibyte-negated-circumflex --- grep-3.7-alt1/tests/unibyte-negated-circumflex 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/unibyte-negated-circumflex 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #!/bin/sh # Exercise a bug where [^^-^] was treated as if it were [^-^]. -# Copyright 2014-2022 Free Software Foundation, Inc. +# Copyright 2014-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -ur grep-3.7-alt1/tests/utf8-bracket grep-3.11-alt1/tests/utf8-bracket --- grep-3.7-alt1/tests/utf8-bracket 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/utf8-bracket 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #!/bin/sh # Check bracket expressions in a UTF-8 locale. -# Copyright 2015-2022 Free Software Foundation, Inc. +# Copyright 2015-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by Только в grep-3.11-alt1/tests: version-pcre diff -ur grep-3.7-alt1/tests/warn-char-classes grep-3.11-alt1/tests/warn-char-classes --- grep-3.7-alt1/tests/warn-char-classes 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/warn-char-classes 2022-05-21 21:41:34.000000000 +0300 @@ -17,10 +17,6 @@ returns_ 1 grep '[[:space:]]' x 2> err || fail=1 test -s err && fail=1 -# disabled by POSIXLY_CORRECT -returns_ 1 env POSIXLY_CORRECT=yes grep '[:space:]' x 2> err || fail=1 -test -s err && fail=1 - # patterns that are considered valid returns_ 1 grep '[::]' x 2> err || fail=1 test -s err && fail=1 diff -ur grep-3.7-alt1/tests/write-error-msg grep-3.11-alt1/tests/write-error-msg --- grep-3.7-alt1/tests/write-error-msg 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/write-error-msg 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #!/bin/sh # Ensure that output errors are reported with errno information. -# Copyright 2016-2022 Free Software Foundation, Inc. +# Copyright 2016-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by Только в grep-3.11-alt1/tests: y2038-vs-32-bit diff -ur grep-3.7-alt1/tests/yesno grep-3.11-alt1/tests/yesno --- grep-3.7-alt1/tests/yesno 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/yesno 2023-01-02 07:36:23.000000000 +0300 @@ -1,7 +1,7 @@ #! /bin/sh # Test feature interaction of -C, -v, -o, and -m. # -# Copyright (C) 2001, 2006, 2009-2022 Free Software Foundation, Inc. +# Copyright (C) 2001, 2006, 2009-2023 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright diff -ur grep-3.7-alt1/tests/z-anchor-newline grep-3.11-alt1/tests/z-anchor-newline --- grep-3.7-alt1/tests/z-anchor-newline 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/tests/z-anchor-newline 2023-01-02 07:36:23.000000000 +0300 @@ -2,7 +2,7 @@ # grep -z with an anchor in the regex could mistakenly match text # including a newline. -# Copyright 2016-2022 Free Software Foundation, Inc. +# Copyright 2016-2023 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by Только в grep-3.11-alt1: THANKS diff -ur grep-3.7-alt1/THANKS.in grep-3.11-alt1/THANKS.in --- grep-3.7-alt1/THANKS.in 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/THANKS.in 2023-04-29 11:38:31.000000000 +0300 @@ -28,6 +28,7 @@ David O'Brien obrien@freebsd.org 'Drake' Daham Wang drakewang@gmail.com Egmont Koblinger egmont@gmail.com +Emanuele Torre torreemanuele6@gmail.com Fernando Basso fernandobasso.br@gmail.com Florian La Roche laroche@redhat.com François Pinard pinard@iro.umontreal.ca @@ -35,6 +36,7 @@ Grant McDorman grant@isgtec.com Greg Boyd gboyd.ccsf@gmail.com Greg Louis glouis@dynamicro.on.ca +Gro-Tsen https://twitter.com/gro_tsen Guglielmo 'bond' Bondioni g.bondioni@libero.it H. Merijn Brand h.m.brand@hccnet.nl Harald Hanche-Olsen hanche@math.ntnu.no @@ -50,9 +52,11 @@ John Hughes john@nitelite.calvacom.fr Jorge Stolfi stolfi@dcc.unicamp.br Karl Heuer kwzh@gnu.org +Karl Pettersson karl.pettersson@klpn.se Kaveh R. Ghazi ghazi@caip.rutgers.edu Kazuro Furukawa furukawa@apricot.kek.jp Keith Bostic bostic@bsdi.com +Koen Claessen koen@chalmers.se Krishna Sethuraman krishna@sgihub.corp.sgi.com Kurt D Schwehr kdschweh@insci14.ucsd.edu Ludovic Courtès ludo@gnu.org @@ -77,6 +81,7 @@ Roland Roberts rroberts@muller.com Ruslan Ermilov ru@freebsd.org Santiago Vila sanvila@unex.es +Sebastian Carlos sebaaa1754@gmail.com Shannon Hill hill@synnet.com Sotiris Vassilopoulos Sotiris.Vassilopoulos@betatech.gr Standish Parsley adsspamtrap01@yahoo.com diff -ur grep-3.7-alt1/TODO grep-3.11-alt1/TODO --- grep-3.7-alt1/TODO 2022-04-02 21:43:55.000000000 +0300 +++ grep-3.11-alt1/TODO 2023-01-02 07:36:23.000000000 +0300 @@ -1,6 +1,6 @@ Things to do for GNU grep - Copyright (C) 1992, 1997-2002, 2004-2022 Free Software Foundation, Inc. + Copyright (C) 1992, 1997-2002, 2004-2023 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright