Index: src/port/path.c
===================================================================
RCS file: /home/cvsmirror/pgsql/src/port/path.c,v
retrieving revision 1.36
diff -c -w -r1.36 path.c
*** src/port/path.c	24 Sep 2004 05:16:35 -0000	1.36
--- src/port/path.c	17 Oct 2004 11:58:00 -0000
***************
*** 175,189 ****
  
  
  /*
!  * Extracts the actual name of the program as called.
   */
  const char *
  get_progname(const char *argv0)
  {
  	if (!last_dir_separator(argv0))
! 		return argv0;
  	else
! 		return last_dir_separator(argv0) + 1;
  }
  
  
--- 175,215 ----
  
  
  /*
!  * Extracts the actual name of the program as called - 
!  * stripped of .exe suffix if any
   */
  const char *
  get_progname(const char *argv0)
  {
+ 	char *nodir_name;
+ #if defined(__CYGWIN__) || defined(WIN32)
+ 	char *exe;
+ #endif
+ 
  	if (!last_dir_separator(argv0))
! 		nodir_name = argv0;
  	else
! 		nodir_name = last_dir_separator(argv0) + 1;
! 
! #if defined(__CYGWIN__) || defined(WIN32)
!     if (strlen(nodir_name) > 4 &&
!         (exe = nodir_name + (strlen(nodir_name) - 4)) &&
!         stricmp(exe, EXE) == 0)
!     {
! 		char *progname;
!         /* strip .exe suffix, regardless of case */
! 		progname = strdup(nodir_name);
! 		if (progname == NULL)
! 		{
! 			fprintf(stderr,"%s: out of memory\n",nodir_name);
! 			exit(1);
! 		}
! 		*(progname + strlen(progname) - 4) = '\0';
! 		nodir_name = progname; 
!     }
! #endif
! 
! 	return nodir_name;
  }
  
  
