Subject: bug#64392: cksum: escaping issues of --check output

From: Pádraig Brady <[email-masked]>
Date: Tue, 11 Jul 2023 12:27:08 +0100

On 01/07/2023 20:12, Christoph Anton Mitterer wrote:
> On Sat, 2023-07-01 at 18:53 +0100, Pádraig Brady wrote:
>> That's not a common case I suppose,
>> so I'm amenable to using the consistent escaping here.
> 
> Good :-)
> 
> 
>> Info docs already contain:
>>
>> "Without ‘--zero’, if FILE contains a backslash, newline, or carriage
>> return, the line is started with a backslash, and each problematic
>> character in the file name is escaped with a backslash, making the
>> output unambiguous even in the presence of arbitrary file names."
> 
> 
> Well yes, but that's in like the "common" section.
> 
> Further down, for --tag, it's explicitly mentioned again there, that
> there's the escaping when \ is present as leading escaping indicator.
> 
> For --untagged and --check there's no such further mentioning ... so at
> least it's a bit inconsistent... and could lead people to think it
> would happen only with --tag.
> 
> 
> Actually I'd even more "definitely" describe the escaping algorithm
> above, in the sense that any \ \r and \n are escaped, and that any
> other \-sequence (like \" \0 \xXX etc.) are explicitly reserved for
> future use.
> This especially in hindsight that other tools may also use the
> tagged/unttaged output formats and add their own add-ons assuming
> they're free to do so.

Full escaping and doc adjustments pushed at:
https://git.sv.gnu.org/cgit/coreutils.git/commit/?id=86614ba1c

cheers,
Pádraig