Hi Christopher,

Christopher Zimmermann wrote on Mon, Dec 20, 2021 at 04:01:49PM +0100:

> base patch cannot work with diffs of binary files. It might help to say 
> so in the manpage since other implementations do support this (ab)use of 
> patch. OK?

I agree you are pointing out a slight problem with the manual page,
but i dislike your patch for two reasons:

This is not a bug, but a fundamental design decision.
The patch(1) manual talks about "lines" throughout,
and for binary files, a concept of "lines" does not even exist.

And the basic idea of a tool ought to be described in the first
sentence of the description, not as an afterthought at the very end.

The problem arises from the manual failing to mention that patch(1)
operates on text files.  Many standard utilities operate on text files
only, the concept of a text-file is both well-known and defined by
POSIX, so there is no need to re-explain what that means in individual
pages.

Consequently, i think something like the following would be better.

Yours,
  Ingo


Index: patch.1
===================================================================
RCS file: /cvs/src/usr.bin/patch/patch.1,v
retrieving revision 1.33
diff -u -r1.33 patch.1
--- patch.1     9 Nov 2021 16:13:40 -0000       1.33
+++ patch.1     20 Dec 2021 15:42:10 -0000
@@ -47,10 +47,12 @@
 .Pf \*(Lt Ar patchfile
 .Sh DESCRIPTION
 .Nm
-will take a patch file containing any of the four forms of difference
+takes the text file
+.Ar patchfile
+containing any of the four forms of difference
 listing produced by the
 .Xr diff 1
-program and apply those differences to an original file,
+program and applies those differences to an original text file,
 producing a patched version.
 If
 .Ar patchfile

Reply via email to