[comp.os.minix] 1.5.3

wimth@gouldnl.encore.nl (Wim ten Have) (03/14/90)

	There is a bug within src/lib/posix/getcwd.c!

	While scanning back from the current directory to the main
	root directory 'getcwd' run's into trouble while reading a
	'.' directory when this contains a empty slot.

	Commands affected:

		- pwd.c
		- tar.c


	The following patch will overcome this problem:

########### BEGIN OF CDIFF
*** getcwd.c.bad	Fri Mar  9 21:12:03 1990
--- getcwd.c	Tue Mar 13 21:22:22 1990
***************
*** 52,57 ****
--- 52,59 ----
  	/* Search the parent directory for the current entry  */
  	if ((fd = open(".", O_RDONLY)) == -1) return((char *)NULL);
  	while (!found && read(fd, (char *)&d, DIRECT_SIZE) == DIRECT_SIZE) {
+ 		if (d.d_ino == 0L)	/*  Empty directory slot */
+ 			continue;
  		if (same_device) {
  			if (current.st_ino == d.d_ino) found = 1;
  		} else {
########### END OF CDIFF

	
-- Wimth,  Wim ten Have Encore Computer Nederland B.V.
	   E-mail:	whave@encore.nl
	   Currently running ST 1.5.3 (Going to ST 1.5.5 soon).

P.S.	   Minix 1.5.3 (1.5.5) is great, good stuff !!!!
	   Credit to Bruce D. Szablak for his 'mdb' tool.
	   Credit to Felix A. Croes for his new 'ld'.
-- 
| Wim ten Have (Software Support Analyst) ...!hp4nl!encore.nl!whave |
| Encore Computer Nederland BV                      whave@encore.nl |
| Maarssenbroek, The Netherlands              (USA) ...!gould!whave |