This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Bug diff 2.8.7: Separate dir


Noticed that when diff is run with two differing files,
one with and one without a directory specifier:
	diff a someDir\b
then all lines are reported as different.
Whereas when both have a directory specifier:
	diff .\a someDir\b
output is normal.
(Filenames, argument order or using -d seem irrelevant.
Using / instead of \ makes output normal also:
	diff a someDir/b
output is normal.
Similarly when comparing a and someDir\a as:
	diff a someDir
output is also normal.
)

As an illustration I have provide a sample batch file.
(It creates up to two directories and two files):
**********
@echo off
setlocal

set bugdir=showSeparateDirDiffBug
if not exist %bugdir%\ md %bugdir%
pushd %bugdir%

set subdir=adir
if not exist %subdir%\ md %subdir%

set file1=a
set file2=%subdir%\%file1%

echo a>%file1%
echo a>>%file1%
echo a>>%file1%

echo a>%file2%
echo b>>%file2%
echo a>>%file2%

echo This batch file: %0
echo.
diff --version
rem Bug
rem same: diff -d %file1% %file2%
diff %file1% %file2%
rem OK
diff .\%file1% %file2%

popd
endlocal
**********
I expect this to run as is on a not too old version of the Windows NT
line of OS.
On my Windows 2000 system this produces the following output:
*************
This batch file: separateDirDiffBug.bat

diff (GNU diffutils) 2.8.7
Written by Paul Eggert, Mike Haertel, David Hayes,
Richard Stallman, and Len Tower.

Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1,3c1,3
< a
< a
< a
---
> a
> b
> a
2c2
< a
---
> b
*************
Since the relevant factor seems to be a directory specifier this bug is
probably Cygwin specific.

(Btw I used a batch file so that the only Cygwin functionality used would be 
directly bug related for clarity. If there is a different format that would
make
it easier to add to the testscripts that are used for the automatic testing
of 
these utilities please provide me with an example so I can model future
similar bugreports along those lines.)


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]