GNU bug report logs - #37844
[PATCH] cmp -x/--verbose-hex

Previous Next

Package: diffutils;

Reported by: "dmo2118 <at> gmail.com" <dmo2118 <at> gmail.com>

Date: Mon, 21 Oct 2019 04:40:02 UTC

Severity: normal

Tags: patch

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "dmo2118 <at> gmail.com" <dmo2118 <at> gmail.com>
To: bug-diffutils <at> gnu.org
Subject: [PATCH] cmp -x/--verbose-hex
Date: Sun, 20 Oct 2019 16:32:20 -0400
[Message part 1 (text/plain, inline)]
This adds a `-x`/`--verbose-hex` option to `cmp`, similar to what FreeBSD has in
its own `cmp`. From `doc/diffutils.texi`:

'-x'
'--verbose-hex'
     Like '--verbose', but with hexadecimal numbers, and byte numbers
     starting at 0.

A few assorted points:
* `cmp -x` always displays a minimum of eight hex digits, just like FreeBSD's
implementation.
* `offtostr` only does decimal, so it was removed in a few places where
hexadecimal was called for.
* Some of the format strings had `%s` replaced with `%"PRIuMAX"`, in part
because of GCC's new `-Wformat-overflow` feature. These strings are translated,
and because it was a simple fix, I updated the `.po` files.
* For `-x`, I replaced "EOF on FILE after byte 511" to "EOF on FILE at byte
0x200". I think it's a bit more useful this way.
* I believe the Malay (`ms.po`) translation needs a bit of attention at this
spot regarding the printf format string:
```
#: src/cmp.c:592
#, fuzzy, c-format
#| msgid "cmp: EOF on %s\n"
msgid "cmp: EOF on %s after byte %s\n"
msgstr "%s: EOF tidak dijangka selepas membaca %d/%d bins\n"
```

This is a bit more than the 15-or-so lines of code that are "not legally
significant for copyright", so let me know if there's paperwork that needs to be
filled out.

Dave Odell

[cmp-x-translations.patch (text/x-patch, attachment)]
[cmp-x.patch (text/x-patch, attachment)]

This bug report was last modified 5 years and 243 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.