In case someone is bored (heh) and looking for a user land bug to fix...

Given this:
   printf '1\n2' >a
   printf '1\n2\n3' >b

Compare the output of
   diff -u a b

with the output of
   diff -uw a b

The former gives this:
--- a   Fri Aug 15 14:08:26 2014
+++ b   Fri Aug 15 14:08:25 2014
@@ -1,2 +1,3 @@
 1
-2
\ No newline at end of file
+2
+3
\ No newline at end of file

Good enough.

The latter however gives a diff that cannot be applied:

--- a   Fri Aug 15 14:08:26 2014
+++ b   Fri Aug 15 14:08:25 2014
@@ -1,2 +1,3 @@
 1
 2+
3

...with no newline on that last line of output.  That's wrong: the -w
option shouldn't break the output format.


Philip Guenther

Reply via email to