Index: fd.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/storage/file/fd.c,v
retrieving revision 1.102
diff -c -r1.102 fd.c
*** fd.c	25 Sep 2003 06:58:02 -0000	1.102
--- fd.c	26 Nov 2003 01:16:02 -0000
***************
*** 1082,1088 ****
  	DO_DB(elog(LOG, "FreeFile: Allocated %d", numAllocatedFiles));
  
  	/* Remove file from list of allocated files, if it's present */
! 	for (i = numAllocatedFiles; --i >= 0;)
  	{
  		if (allocatedFiles[i] == file)
  		{
--- 1082,1088 ----
  	DO_DB(elog(LOG, "FreeFile: Allocated %d", numAllocatedFiles));
  
  	/* Remove file from list of allocated files, if it's present */
! 	for (i = (numAllocatedFiles-1); --i >= 0;)
  	{
  		if (allocatedFiles[i] == file)
  		{
***************
*** 1181,1187 ****
  	}
  
  	while (numAllocatedFiles > 0)
! 		FreeFile(allocatedFiles[0]);
  }
  
  
--- 1181,1187 ----
  	}
  
  	while (numAllocatedFiles > 0)
! 		FreeFile(allocatedFiles[numAllocatedFiles-1]);
  }
  
  
