[binutils-gdb] Update description of string's -n option.

Nick Clifton nickc@sourceware.org
Mon Nov 29 14:53:04 GMT 2021


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8fee99c3c8e25f2708bddde345c192dd2f3e7e08

commit 8fee99c3c8e25f2708bddde345c192dd2f3e7e08
Author: Nick Clifton <nickc@redhat.com>
Date:   Mon Nov 29 14:52:42 2021 +0000

    Update description of string's -n option.
    
            PR 28632
            * strings.c (usage): Update desciption of -n option.
            * doc/binutils.texi: Likewise.

Diff:
---
 binutils/ChangeLog         | 6 ++++++
 binutils/doc/binutils.texi | 9 +++++++--
 binutils/strings.c         | 7 ++++---
 3 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index cc742ec4951..4c9879b52e4 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
+2021-11-29  Nick Clifton  <nickc@redhat.com>
+
+	PR 28632
+	* strings.c (usage): Update desciption of -n option.
+	* doc/binutils.texi: Likewise.
+
 2021-11-24  Nick Clifton  <nickc@redhat.com>
 
 	PR 28564
diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi
index fb5dc8ed568..1f3e6c7bc85 100644
--- a/binutils/doc/binutils.texi
+++ b/binutils/doc/binutils.texi
@@ -3297,8 +3297,13 @@ Print a summary of the program usage on the standard output and exit.
 @item -@var{min-len}
 @itemx -n @var{min-len}
 @itemx --bytes=@var{min-len}
-Print sequences of characters that are at least @var{min-len} characters
-long, instead of the default 4.
+Print sequences of displayable characters that are at least
+@var{min-len} characters long.  If not specified a default minimum
+length of 4 is used.  The distinction between displayable and
+non-displayable characters depends upon the setting of the 
+@option{-e} and @option{-U} options.  Sequences are always terminated
+at control characters such as new-line and carriage-return, but not
+the tab character.
 
 @item -o
 Like @samp{-t o}.  Some other versions of @command{strings} have @option{-o}
diff --git a/binutils/strings.c b/binutils/strings.c
index 13db60f57a5..f594299939f 100644
--- a/binutils/strings.c
+++ b/binutils/strings.c
@@ -32,7 +32,8 @@
    --bytes=min-len
    -n min-len
    -min-len	Print graphic char sequences, MIN-LEN or more bytes long,
-		that are followed by a NUL or a newline.  Default is 4.
+		that are followed by a NUL or a non-displayable character.
+		Default is 4.
 
    --radix={o,x,d}
    -t {o,x,d}	Print the offset within the file before each string,
@@ -1323,8 +1324,8 @@ usage (FILE *stream, int status)
 
   fprintf (stream, _("\
   -f --print-file-name      Print the name of the file before each string\n\
-  -n --bytes=[number]       Locate & print any NUL-terminated sequence of at\n\
-  -<number>                   least [number] characters (default 4).\n\
+  -n <number>               Locate & print any sequence of at least <number>\n\
+    --bytes=<number>         displayable characters.  (The default is 4).\n\
   -t --radix={o,d,x}        Print the location of the string in base 8, 10 or 16\n\
   -w --include-all-whitespace Include all whitespace as valid string characters\n\
   -o                        An alias for --radix=o\n\


More information about the Binutils-cvs mailing list