Article View: gnu.utils.bug
Article #1458diff-1.4 bug.
From: Roger Florkowski
Date: Fri, 20 Jan 1989 08:21
Date: Fri, 20 Jan 1989 08:21
32 lines
1327 bytes
1327 bytes
In diff-1.4, there is a bug when you:
diff filename dirname
where filename is contained in the directory dirname. The bug
is that compare_files frees the dirname even though it came
from argv[]. This patch checks if should free it first.
*** diff.c~ Fri Oct 7 03:18:42 1988
--- diff.c Fri Jan 20 02:56:43 1989
***************
*** 476,482 ****
}
else
{
! free (inf[dir_arg].name);
inf[dir_arg].name = filename;
if (fstat (inf[dir_arg].desc, &inf[dir_arg].stat) < 0)
pfatal_with_name (inf[dir_arg].name);
--- 476,483 ----
}
else
{
! if ( 0 != (dir_arg ? dir1 : dir0))
! free (inf[dir_arg].name);
inf[dir_arg].name = filename;
if (fstat (inf[dir_arg].desc, &inf[dir_arg].stat) < 0)
pfatal_with_name (inf[dir_arg].name);
--
Roger Florkowski uunet!uvm-gen!banzai!roger
The People's Computer Company `Revolutionary Programming'
Technical Details
Message-ID:
<8901200321.AA05333@banzai.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!uunet!tut.cis.ohio-state.edu!UUNET.UU.NET!uvm-gen!banzai!rogerShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!uunet!tut.cis.ohio-state.edu!UUNET.UU.NET!uvm-gen!banzai!roger From: uvm-gen!banzai!roger@UUNET.UU.NET (Roger Florkowski) Newsgroups: gnu.utils.bug Subject: diff-1.4 bug. Message-ID: <8901200321.AA05333@banzai.UUCP> Date: 20 Jan 89 08:21:02 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 32