grep-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grep branch, master, updated. v3.11-24-g443961a


From: Paul Eggert
Subject: grep branch, master, updated. v3.11-24-g443961a
Date: Mon, 29 Jan 2024 01:57:23 -0500 (EST)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  443961a929a952dd653255ca6c0947d416d9c1a3 (commit)
      from  e248db797a7550cd10045e4eaf575f6507f71cf5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=443961a929a952dd653255ca6c0947d416d9c1a3


commit 443961a929a952dd653255ca6c0947d416d9c1a3
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Sun Jan 28 22:55:41 2024 -0800

    Improve doc for range expressions
    
    grep currently doesn’t implement rational ranges or any other
    particular behavior for range expressions outside the C locale.
    Adjust the documentation to match the behavior more closely.
    Problem reported by Ronan Pigott in:
    https://lists.gnu.org/r/grep-devel/2024-01/msg00000.html
    * doc/grep.texi (Character Classes and Bracket Expressions):
    Be more careful about terminology.  Don’t say “sorts” because
    the collation sequence is not the same as the sort order.
    Don’t make promises about behavior outside the C locale,
    as the current code might not fulfill them.
    * doc/grep.in.1: Adjust wording to match.  The old wording
    was out-of-sync anyway.

diff --git a/doc/grep.in.1 b/doc/grep.in.1
index 4220493..55118a7 100644
--- a/doc/grep.in.1
+++ b/doc/grep.in.1
@@ -808,19 +808,21 @@ matches any single digit.
 Within a bracket expression, a
 .I "range expression"
 consists of two characters separated by a hyphen.
-It matches any single character that sorts between the two characters,
-inclusive, using the locale's collating sequence and character set.
-For example, in the default C locale,
+In the default C locale, it matches any single character that appears
+between the two characters in ASCII order, inclusive.
+For example,
 .B [a\-d]
 is equivalent to
 .BR [abcd] .
-Many locales sort characters in dictionary order, and in these locales
+In other locales the behavior is unspecified:
 .B [a\-d]
-is typically not equivalent to
-.BR [abcd] ;
-it might be equivalent to
-.BR [aBbCcDd] ,
-for example.
+might be equivalent to
+.B [abcd]
+or
+.B [aBbCcDd]
+or some other bracket expression,
+or it might fail to match any character, or the set of
+characters that it matches might be erratic, or it might be invalid.
 To obtain the traditional interpretation of bracket expressions,
 you can use the C locale by setting the
 .B LC_ALL
diff --git a/doc/grep.texi b/doc/grep.texi
index 508b1cd..7d10f86 100644
--- a/doc/grep.texi
+++ b/doc/grep.texi
@@ -1325,13 +1325,13 @@ encoding error.
 @cindex range expression
 Within a bracket expression, a @dfn{range expression} consists of two
 characters separated by a hyphen.
-It matches any single character that
-sorts between the two characters, inclusive.
-In the default C locale, the sorting sequence is the native character
-order; for example, @samp{[a-d]} is equivalent to @samp{[abcd]}.
-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
+In the default C locale, it matches any single character that appears
+between the two characters in ASCII order, inclusive.
+For example, @samp{[a-d]} is equivalent to @samp{[abcd]}.
+In other locales the behavior is unspecified:
+@samp{[a-d]} might be equivalent to
+@samp{[abcd]} or @samp{[aBbCcDd]} or some other bracket expression,
+or it might fail to match any character, or the set of
 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
@@ -1734,8 +1734,9 @@ 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
+these range expressions use native code points, or use the collation
+sequence specified by the @env{LC_COLLATE} category, or use the
+collation ordering used by @command{sort} and @code{strcoll}, 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

-----------------------------------------------------------------------

Summary of changes:
 doc/grep.in.1 | 20 +++++++++++---------
 doc/grep.texi | 19 ++++++++++---------
 2 files changed, 21 insertions(+), 18 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

[Prev in Thread] Current Thread [Next in Thread]