🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #1402

'diff -rs' should not report identical subtrees to be "files"

#1402
From: Paul Eggert
Date: Sat, 05 Nov 1988 20:21
30 lines
1203 bytes
GNU diff 1.4 exhibits the following behavior (under SunOS 4.0 on a Sun-3/60):

	% mkdir a b 
	% touch a/f b/f 
	% diff -rs a b 
	Files a/f and b/f are identical
	Files a and b are identical

The second message is wrong, because `a' and `b' are not regular files.
Here is a fix.

*** diff1.4/diff.c	Sat Nov  5 12:15:57 1988
--- diffnew/diff.c	Sat Nov  5 12:14:54 1988
***************
*** 537,543 ****
      close (inf[1].desc);
  
   done:
!   if (val == 0 && print_file_same_flag)
      message ("Files %s and %s are identical\n",
  	     inf[0].name, inf[1].name);
  
--- 537,543 ----
      close (inf[1].desc);
  
   done:
!   if (val == 0 && print_file_same_flag && !inf[0].dir_p)
      message ("Files %s and %s are identical\n",
  	     inf[0].name, inf[1].name);
  
Technical Details
Message-ID: <8811052021.AA15667@poi.sm.unisys.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!SM.UNISYS.COM!eggert

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!SM.UNISYS.COM!eggert
From: eggert@SM.UNISYS.COM (Paul Eggert)
Newsgroups: gnu.utils.bug
Subject: 'diff -rs' should not report identical subtrees to be "files"
Message-ID: <8811052021.AA15667@poi.sm.unisys.com>
Date: 5 Nov 88 20:21:44 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 30