Closed 0x5c closed 1 year ago
It seems that gnu patch does indeed consider the backslash only.
Wrote the output of $ LANG=fr_CA.UTF-8 diff -u aaa bbb
to test.patch
--- aaa 2023-03-15 01:46:21.639805928 -0400
+++ bbb 2023-03-15 01:46:31.812927237 -0400
@@ -1 +1 @@
-yo
\ Pas de fin de ligne à la fin du fichier
+yo
$ patch -u -o ccc aaa test.patch
indeed produces a ccc
file which is identical to bbb
.
EDIT: did the same test with a patch file that had \ Hello world, will this line break patch?
, with the same result.
Nice catch @0x5c!
When the system language is not english, the output of
diff -u
will not contain the string\ No newline at end of file
, but instead some translated text in the user's locale.aaa
bbb
(the text is
\ Pas de fin de ligne à la fin du fichier
)I would assume that the exact text used isn't part of the unified diff format, and at only the
\
on col 1 of the line matters. It seems that gnu patch does indeed only care about the backslash, although I'm not sure if my reading of that code is correct.