From 3dc94feb2e6378661f689469493bbef33fa7df85 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@fb.com>
Date: Thu, 9 Mar 2023 06:25:18 -0800
Subject: [PATCH] doc: remove mention of unused _N_GNU_nonoption_argv_flags_
 envvar

* doc/grep.texi (Environment Variables): This environment variable
has not been usable for decades. Remove its documentation.
* doc/grep.in.1: Likewise.
Reported by Emanuele Torre torreemanuele6@gmail.com
in https://bugs.gnu.org/62052
* THANKS.in: Add the name.
---
 THANKS.in     |  1 +
 doc/grep.in.1 | 25 -------------------------
 doc/grep.texi | 12 ------------
 3 files changed, 1 insertion(+), 37 deletions(-)

diff --git a/THANKS.in b/THANKS.in
index 17842e1..fd36192 100644
--- a/THANKS.in
+++ b/THANKS.in
@@ -28,6 +28,7 @@ David J MacKenzie                   djm@catapult.va.pubnix.com
 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
diff --git a/doc/grep.in.1 b/doc/grep.in.1
index 90205ce..edc4bc7 100644
--- a/doc/grep.in.1
+++ b/doc/grep.in.1
@@ -1243,31 +1243,6 @@ front of the operand list and are treated as options.
 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;
diff --git a/doc/grep.texi b/doc/grep.texi
index 9b3aa03..621beaf 100644
--- a/doc/grep.texi
+++ b/doc/grep.texi
@@ -1060,18 +1060,6 @@ and are treated as options.
 This variable specifies the output terminal type, which can affect
 what the @option{--color} option does.  @xref{General Output Control}.

-@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.
-
 @end table

 The @env{GREP_OPTIONS} environment variable of @command{grep} 2.20 and
-- 
2.40.0.rc2

