Index: src/bin/initdb/initdb.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/bin/initdb/initdb.c,v retrieving revision 1.22 diff -c -r1.22 initdb.c *** src/bin/initdb/initdb.c 2 Feb 2004 00:11:31 -0000 1.22 --- src/bin/initdb/initdb.c 4 Mar 2004 04:55:43 -0000 *************** *** 151,157 **** /* forward declare all our functions */ static bool rmtree(char *, bool); static void exit_nicely(void); - static void canonicalize_path(char *); #ifdef WIN32 static char *expanded_path(char *); #else --- 151,156 ---- *************** *** 287,317 **** return !system(buf); } - - /* - * make all paths look like unix, with forward slashes - * also strip any trailing slash. - * - * The Windows command processor will accept suitably quoted paths - * with forward slashes, but barfs badly with mixed forward and back - * slashes. Removing the trailing slash on a path means we never get - * ugly double slashes. Don't remove a leading slash, though. - */ - static void - canonicalize_path(char *path) - { - char *p; - - for (p = path; *p; p++) - { - #ifdef WIN32 - if (*p == '\\') - *p = '/'; - #endif - } - if (p > path+1 && *--p == '/') - *p = '\0'; - } /* * make a copy of the array of lines, with token replaced by replacement --- 286,291 ---- Index: src/include/port.h =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/include/port.h,v retrieving revision 1.20 diff -c -r1.20 port.h *** src/include/port.h 25 Feb 2004 19:41:23 -0000 1.20 --- src/include/port.h 4 Mar 2004 04:55:44 -0000 *************** *** 21,26 **** --- 21,27 ---- extern bool is_absolute_path(const char *filename); extern char *first_path_separator(const char *filename); extern char *last_path_separator(const char *filename); + extern void canonicalize_path(char *path); extern char *get_progname(char *argv0); /* Portable delay handling */ Index: src/port/path.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/port/path.c,v retrieving revision 1.4 diff -c -r1.4 path.c *** src/port/path.c 29 Nov 2003 19:52:13 -0000 1.4 --- src/port/path.c 4 Mar 2004 04:55:44 -0000 *************** *** 85,90 **** --- 85,116 ---- /* + * make all paths look like unix, with forward slashes + * also strip any trailing slash. + * + * The Windows command processor will accept suitably quoted paths + * with forward slashes, but barfs badly with mixed forward and back + * slashes. Removing the trailing slash on a path means we never get + * ugly double slashes. Don't remove a leading slash, though. + */ + void + canonicalize_path(char *path) + { + char *p; + + for (p = path; *p; p++) + { + #ifdef WIN32 + if (*p == '\\') + *p = '/'; + #endif + } + if (p > path+1 && *--p == '/') + *p = '\0'; + } + + + /* * Extracts the actual name of the program as called. */ char *