Index: src/port/path.c =================================================================== RCS file: /cvsroot/pgsql/src/port/path.c,v retrieving revision 1.38 diff -c -c -r1.38 path.c *** src/port/path.c 27 Oct 2004 17:17:09 -0000 1.38 --- src/port/path.c 1 Nov 2004 04:21:56 -0000 *************** *** 195,202 **** #if defined(__CYGWIN__) || defined(WIN32) /* strip .exe suffix, regardless of case */ ! if (strlen(nodir_name) > 4 && ! stricmp(nodir_name + (strlen(nodir_name) - 4), EXE) == 0) { char *progname; --- 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; *************** *** 206,212 **** fprintf(stderr, "%s: out of memory\n", nodir_name); exit(1); } ! progname[strlen(progname) - 4] = '\0'; nodir_name = progname; } #endif --- 206,212 ---- fprintf(stderr, "%s: out of memory\n", nodir_name); exit(1); } ! progname[strlen(progname) - sizeof(EXE)] = '\0'; nodir_name = progname; } #endif