On Sun, Jan 5, 2025 at 11:38 AM Andreas Grünbacher
<[email protected]> wrote:
...
> > Technically, I don't see how that POSIX guidance for patch can justify
> > this behavior, since patch's output file name is just "b" in this
> > example:
> >
> >   $ f=$'a\na'; echo a>"$f"; echo b>b; diff -u b "$f" |patch b
> >   patch: **** quoted string "a\n..." contains newline
>
> Indeed, rejecting patches because they contain filenames that aren't
> even used is not helpful.
>
> > But their suggestion to diagnose or even fail for NL-afflicted file
> > names is fine advice, so I shouldn't be splitting hairs with the
> > example above. IMHO, it is fine and even desirable to discourage
> > NL-afflicted files.
> >
> > Re my current question (how to adjust that diff manual section), I'm
> > happy to make it say that all special characters are covered,
> > **except** newline, whose presence in any file name is strongly
> > discouraged.
>
> How about we change diff and patch to accept but warn about newlines
> in filenames?

I'll be happy to make diffutils warn about NL-afflicted file names,
but not before the impending release.

Reply via email to