bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

diff -u produces inconsistent header when comparing to a 1-line file


From: Aaron Bentley
Subject: diff -u produces inconsistent header when comparing to a 1-line file
Date: Wed, 09 Feb 2005 12:20:07 -0500
User-agent: Mozilla Thunderbird 0.6 (X11/20040530)

Here's an example:
$ echo hello | diff -u - /dev/null
--- -   2005-02-09 12:08:11.000000000 -0500
+++ /dev/null   2004-02-26 20:16:33.000000000 -0500
@@ -1 +0,0 @@
-hello

The -1 is not a comma-separated pair, but for all other sizes it is a comma-separated pair. Note that 1,2 is used for a two-line file, and 1,3 is used for a three-liner, so 1,1 would be the expected value.

I have been unable to find a spec for the unified diff output format, so I can only guess at what's a bug. If it's not, are there other cases to which this header format applies, or a spec I can read?

Aaron

--
Aaron Bentley
Director of Technology
Panometrics, Inc.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]