coreutils/backport-doc-od-strings-clarify-operation.patch
fly_fzc b1840f7ab9 coreutils:sync patches from community
(cherry picked from commit c77ff335ff89d7cb9ad7caaa6f19d3437996991d)
2023-10-10 15:09:34 +08:00

53 lines
2.2 KiB
Diff

From 66ea09b0fecb4fa1e4de78e3738bdbb1442b3f31 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
Date: Thu, 8 Jun 2023 10:58:10 +0100
Subject: [PATCH] doc: od --strings: clarify operation
* doc/coreutils.texi (od invocation): Remove mention of ASCII,
as all printable characters in unibyte locales are output.
* src/od.c (usage): Clarify that only NUL terminated strings
are displayed, and that it's printable chars, not only graphic chars
that are output. I.e., spaces are output also if part of the string.
Reported at https://bugs.ddebian.org/1037217
Reference:https://github.com/coreutils/coreutils/commit/66ea09b0fecb4fa1e4de78e3738bdbb1442b3f31
Conflict:NA
---
doc/coreutils.texi | 2 +-
src/od.c | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 6a693e283..e9d7b8eb4 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -2058,7 +2058,7 @@ Output at most @var{bytes} bytes of the input. Prefixes and suffixes on
@opindex --strings
@cindex string constants, outputting
Instead of the normal output, output only @dfn{string constants}: at
-least @var{bytes} consecutive ASCII graphic characters,
+least @var{bytes} consecutive printable characters,
followed by a zero byte (ASCII NUL).
Prefixes and suffixes on @var{bytes} are interpreted as for the
@option{-j} option.
diff --git a/src/od.c b/src/od.c
index 10a28e21f..f68407008 100644
--- a/src/od.c
+++ b/src/od.c
@@ -356,9 +356,8 @@ suffixes may be . for octal and b for multiply by 512.\n\
"), stdout);
fputs (_("\
-N, --read-bytes=BYTES limit dump to BYTES input bytes\n\
- -S BYTES, --strings[=BYTES] output strings of at least BYTES graphic chars;\
-\n\
- 3 is implied when BYTES is not specified\n\
+ -S BYTES, --strings[=BYTES] show only NUL terminated strings\n\
+ of at least BYTES (3) printable characters\n\
-t, --format=TYPE select output format or formats\n\
-v, --output-duplicates do not use * to mark line suppression\n\
-w[BYTES], --width[=BYTES] output BYTES bytes per output line;\n\
--
2.27.0