Commit Graph

11 Commits

Author SHA1 Message Date
FRIGN 79e45395e5 Refactor cmp(1) code and manpage
The algorithm had some areas which had potential for improvement.
This should make cmp(1) faster.
There have been changes to behaviour as well:

1) If argv[0] and argv[1] are the same, cmp(1) returns Same.
2) POSIX specifies the format of the difference-message to be:
      "%s %s differ: char %d, line %d\n", file1, file2,
      <byte number>, <line number>
   However, as cmp(1) operates on bytes, not characters, I changed
   it to
      "%s %s differ: byte %d, line %d\n", file1, file2,
      <byte number>, <line number>
   This is one example where the standard just keeps the old format
   for backwards-compatibility. As this is harmful, this change
   makes sense in the sense of consistentcy (and because we take
   the difference of char and byte very seriously in sbase, as
   opposed to GNU coreutils).

The manpage has been annotated, reflecting the second change, and
sections shortened where possible.
Thus I marked cmp(1) as finished in README.
2015-02-07 21:05:33 +01:00
Hiltjo Posthuma 96fc8383cd man pages: fix some typos 2015-02-01 21:28:17 +01:00
sin 0934e7f6ed Add .Os sbase and sed replace to .Os sbase $(VERSION) in make install 2015-01-31 19:37:03 +00:00
Hiltjo Posthuma 4a920a5960 remove sbase-VERSION from man page, fix sponge.1 date 2015-01-31 14:20:02 +01:00
Hiltjo Posthuma 57a19e3b86 add some mandoc pages and fix some warnings
- add .Os, it is mandatory.
- don't redeclare .Nm when it's not needed.
- fix some warnings (checked with mandoc -Tlint).
- remove some leftover old stuff.
2015-01-30 21:21:50 +01:00
sin 78a55f6daf Another update to cmp.1 2014-11-21 13:12:36 +00:00
sin cf705e6a24 Minor update to cmp(1) manpage 2014-11-21 13:12:16 +00:00
sin 102f579d0f cmp(1) is POSIX compliant so mention it in the manpage
Update format specifiers for -l as specified by POSIX.
2014-11-21 12:32:07 +00:00
sin 2d685482af Update cmp(1) manpage to new style and do not allow both -l and -s to be set 2014-11-21 12:04:07 +00:00
Hiltjo Posthuma 1599880c93 update some man pages
*sum tools: -c was added
tr: -d flag was added.
xargs: -n flag was added.
cmp: minor typo (change to lowercase).

Signed-off-by: Hiltjo Posthuma <>
2014-04-12 20:33:33 +01:00
Connor Lane Smith 188d8ff93a add cmp, thanks stateless 2011-06-10 01:55:12 +01:00