[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 4/4] digest: support windows format checksum files
From: |
Eric Blake |
Subject: |
Re: [PATCH 4/4] digest: support windows format checksum files |
Date: |
Fri, 17 Sep 2021 12:48:19 -0500 |
User-agent: |
NeoMutt/20210205-772-2b4c52 |
On Wed, Sep 15, 2021 at 01:40:36PM +0100, Pádraig Brady wrote:
> Support checksum files with CRLF line endings,
> which is a common gotcha for using --check on windows,
> or with checksum files generated on windows.
> Note we escape \r here to support the original coreutils format
> (with file name at EOL), and file names with literal
> \r characters as the last character of their name.
>
> +++ b/doc/coreutils.texi
> @@ -4066,10 +4066,12 @@ Binary mode is indicated with @samp{*}, text mode
> with @samp{ } (space).
> Binary mode is the default on systems where it's significant,
> otherwise text mode is the default. The @command{cksum} command always
> uses binary mode and a @samp{ } (space) flag.
> -Without @option{--zero}, if @var{file} contains a backslash or newline,
> -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.
Pre-existing, but...
> +
> +Without @option{--zero}, if @var{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.
We output backslash-n, not backslash-newline, when escaping newline.
And with the new carriage return escaping, we output backslash-r, not
backslash-CR. So this sentence is a bit misleading in stating that
the problematic character is escaped with backslash, when in reality
it is replaced by an escape sequence that starts with backslash.
Overall, I like where you're headed with this.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
- [PATCH 11/12] digest: support -length specifiers on all digest tags, (continued)
- [PATCH 11/12] digest: support -length specifiers on all digest tags, Pádraig Brady, 2021/09/12
- Re: [PATCH V2] Add support for cksum --algorithm [sm3], Pádraig Brady, 2021/09/12
- Re: [PATCH V2] Add support for cksum --algorithm [sm3], Pádraig Brady, 2021/09/14
- Re: [PATCH V2] Add support for cksum --algorithm [sm3], Jim Meyering, 2021/09/14
- [PATCH 3/4] doc: improve --help indenting in checksum utils, Pádraig Brady, 2021/09/15
- [PATCH 1/4] cksum: use --tag format by default, Pádraig Brady, 2021/09/15
- Re: [PATCH 1/4] cksum: use --tag format by default, Eric Blake, 2021/09/17
- Re: [PATCH 1/4] cksum: use --tag format by default, Pádraig Brady, 2021/09/17
- Re: [PATCH 1/4] cksum: use --tag format by default, Pádraig Brady, 2021/09/20
- [PATCH 4/4] digest: support windows format checksum files, Pádraig Brady, 2021/09/15
- Re: [PATCH 4/4] digest: support windows format checksum files,
Eric Blake <=
- [PATCH 2/4] cksum: operate in binary mode only, Pádraig Brady, 2021/09/15
- Re: [PATCH V2] Add support for cksum --algorithm [sm3], Eric Blake, 2021/09/17