From 1935528ce9eba1df285dc05fbb8cf3c083334078 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?=
Date: Tue, 15 Dec 2020 01:06:50 +0000
Subject: [PATCH] doc: mention the GNU extensions to nl --section-delimiter
* doc/coreutils.texi (nl invocation): Mention the GNU extensions
of allowing arbitrary length and empty delimiter strings.
* src/nl.c (usage): Likewise.
* tests/misc/nl.sh: Add test cases for the GNU extensions.
---
doc/coreutils.texi | 9 ++++++---
src/nl.c | 4 +++-
tests/misc/nl.sh | 20 ++++++++++++++++++++
3 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 5ac3745bd0..df0655c208 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -1805,9 +1805,9 @@ start of body;
start of footer.
@end table
-The two characters from which these strings are made can be changed from
-@samp{\} and @samp{:} via options (see below), but the pattern and
-length of each string cannot be changed.
+The characters from which these strings are made can be changed from
+@samp{\} and @samp{:} via options (see below), but the pattern
+of each string cannot be changed.
A section delimiter is replaced by an empty line on output. Any text
that comes before the first section delimiter string in the input file
@@ -1847,6 +1847,9 @@ expression @var{bre}.
@cindex section delimiters of pages
Set the section delimiter characters to @var{cd}; default is
@samp{\:}. If only @var{c} is given, the second remains @samp{:}.
+As a GNU extension more than two characters can be specified,
+and also if @var{cd} is empty (@option{-d ''}), then section
+matching is disabled.
(Remember to protect @samp{\} or other metacharacters from shell
expansion with quotes or extra backslashes.)
diff --git a/src/nl.c b/src/nl.c
index a1b38a7e27..23219b6091 100644
--- a/src/nl.c
+++ b/src/nl.c
@@ -211,7 +211,9 @@ Write each FILE to standard output, with line numbers added.\n\
Default options are: -bt -d'\\:' -fn -hn -i1 -l1 -n'rn' -s