From dfaa846f093277db65944774497abb348e63760a Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 5 Jan 2025 11:35:28 -0800 Subject: [PATCH] doc: rewrite the "Unusual File Names" section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/diffutils.texi (Unusual File Names): Rewrite to reflect that file names with e.g., NL and TAB are now quoted. Reported by Matěj Cepl in . --- doc/diffutils.texi | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/doc/diffutils.texi b/doc/diffutils.texi index 69b31da..1d89353 100644 --- a/doc/diffutils.texi +++ b/doc/diffutils.texi @@ -4750,13 +4750,14 @@ and @command{patch} should be extended to understand these extensions. @subsection File Names that Contain Unusual Characters @cindex file names with unusual characters -When a file name contains an unusual character like a newline or -white space, @samp{diff -r} generates a patch that @command{patch} cannot -parse. The problem is with format of @command{diff} output, not just with -@command{patch}, because with odd enough file names one can cause -@command{diff} to generate a patch that is syntactically correct but -patches the wrong files. The format of @command{diff} output should be -extended to handle all possible file names. +Since diffutils-3.3, file names have been encoded to eliminate the ambiguity +of unusual characters like newline and TAB. +However, since any file name containing a newline may easily cause trouble, +in so many contexts (not just diff and patch), a future version of +diff may well reject attempts to operate on such names. +@c FIXME-in-2026 consider rejecting NL-afflicted file names +@c keep an eye on POSIX, e.g., +@c https://pubs.opengroup.org/onlinepubs/9799919799/utilities/diff.html @node Timestamp Order @subsection Outputting Diffs in Timestamp Order