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

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

diff --rcs and no newline at end of file


From: Yann Droneaud
Subject: diff --rcs and no newline at end of file
Date: Mon, 29 Nov 2004 17:40:39 +0100
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Hi,

i noticed a small bug in the output of diff --rcs --recursive (diff -nr)
when a file did have a new line at the end. If the file is the last one
with differences, the problem is hidden. 

example:
---------------------------------
mkdir dir1 dir2
echo "line1" > dir1/01
echo -en "line1\nline2" > dir2/01
touch dir1/02
echo "foo" > dir2/02
diff -nr dir1/ dir2/
---------------------------------

Produce the following output:
-----------------------------
diff -nr dir1/01 dir2/01
a1 1
line2diff -nr dir1/02 dir2/02
a0 1
fooo
-----------------------------

diff --ed (diff -e) produce a warning message and doesn't clobber the
output (user is warned the patch won't produce the same files).
diff --rcs (diff -n) should behave the same.

But i'm still wondering who use this patch format (GNU patch doesn't
handle such patch).

Regards

-- 
Yann Droneaud      <address@hidden>        +33 6 88 40 82 43
<address@hidden>  <address@hidden>  <address@hidden>
http://droneaud.com/ http://meuh.org/ http://meuh.tuxfamily.org/
1024D/BEA43321 5D91 B5B0 5137 B8FE 6882 FE19 CAA0 6F05 BEA4 3321




reply via email to

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