🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Paul Eggert Thu, 03 Nov 1988 03:04
GNU diff 1.4 bug fix: typo in test for directories
#1400
Author: Paul Eggert
Date: Thu, 03 Nov 1988 03:04
27 lines
1284 bytes
GNU diff 1.4 does not correctly test whether a file is a directory.
The code says (S_IFDIR == (mode & S_IFDIR)) where it should say (S_IFDIR ==
(mode & S_IFMT)).  The bug is rarely exercised because (under SunOS 4.0,
anyway) only block special files and sockets are mishandled.

Here is a fix.

*** 1.4/diff.c	Wed Nov  2 18:59:24 1988
--- fix/diff.c	Wed Nov  2 18:56:31 1988
***************
*** 381,383 ****
  	  else
! 	    inf[i].dir_p = (S_IFDIR == (inf[i].stat.st_mode & S_IFDIR));
  	}
--- 381,383 ----
  	  else
! 	    inf[i].dir_p = (S_IFDIR == (inf[i].stat.st_mode & S_IFMT));
  	}
***************
*** 484,486 ****
  	  inf[dir_arg].dir_p
! 	    = (S_IFDIR == (inf[dir_arg].stat.st_mode & S_IFDIR));
  	  if (inf[dir_arg].dir_p)
--- 484,486 ----
  	  inf[dir_arg].dir_p
! 	    = (S_IFDIR == (inf[dir_arg].stat.st_mode & S_IFMT));
  	  if (inf[dir_arg].dir_p)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads