Index: src/port/path.c
===================================================================
RCS file: /cvsroot/pgsql/src/port/path.c,v
retrieving revision 1.39
diff -c -c -r1.39 path.c
*** src/port/path.c	1 Nov 2004 04:25:18 -0000	1.39
--- src/port/path.c	1 Nov 2004 04:45:55 -0000
***************
*** 195,202 ****
  
  #if defined(__CYGWIN__) || defined(WIN32)
  	/* strip .exe suffix, regardless of case */
! 	if (strlen(nodir_name) > sizeof(EXE) &&
! 		pg_strcasecmp(nodir_name + strlen(nodir_name) - sizeof(EXE), EXE) == 0)
  	{
  		char *progname;
  
--- 195,202 ----
  
  #if defined(__CYGWIN__) || defined(WIN32)
  	/* strip .exe suffix, regardless of case */
! 	if (strlen(nodir_name) > sizeof(EXE) - 1 &&
! 		pg_strcasecmp(nodir_name + strlen(nodir_name)-sizeof(EXE)-1, EXE) == 0)
  	{
  		char *progname;
  
***************
*** 206,212 ****
  			fprintf(stderr, "%s: out of memory\n", nodir_name);
  			exit(1);
  		}
! 		progname[strlen(progname) - sizeof(EXE)] = '\0';
  		nodir_name = progname; 
  	}
  #endif
--- 206,212 ----
  			fprintf(stderr, "%s: out of memory\n", nodir_name);
  			exit(1);
  		}
! 		progname[strlen(progname) - sizeof(EXE) - 1] = '\0';
  		nodir_name = progname; 
  	}
  #endif
