1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-03 15:22:11 +03:00

Attached is a patch that takes care of the PATHSEP issue. I made a more

extensive change then what was suggested. I found the file path.c that
contained a lot of "Unix/Windows" agnostic functions so I added a function
there instead and removed the PATHSEP declaration in exec.c altogether. All
to keep things from scattering all over the code.

I also took the liberty of changing the name of the functions
"first_path_sep" and "last_path_sep". Where I come from (and I'm apparently
not alone given the former macro name PATHSEP), they should be called
"first_dir_sep" and "last_dir_sep". The new function I introduced, that
actually finds path separators, is now the "first_path_sep". The patch
contains changes on all affected places of course.

I also changed the documentation on dynamic_library_path to reflect the
chagnes.

Thomas Hallgren
This commit is contained in:
Bruce Momjian
2004-06-10 22:26:24 +00:00
parent d4117de50a
commit 6cc4175b25
10 changed files with 85 additions and 50 deletions

View File

@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/port.h,v 1.41 2004/06/10 16:35:18 momjian Exp $
* $PostgreSQL: pgsql/src/include/port.h,v 1.42 2004/06/10 22:26:20 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -22,8 +22,22 @@
bool set_noblock(int sock);
/* Portable path handling for Unix/Win32 */
/* Find the location of the first directory separator, return
* NULL if not found.
*/
extern char *first_dir_separator(const char *filename);
/* Find the location of the last directory separator, return
* NULL if not found.
*/
extern char *last_dir_separator(const char *filename);
/* Find the location of the first path separator (i.e. ':' on
* Unix, ';' on Windows), return NULL if not found.
*/
extern char *first_path_separator(const char *filename);
extern char *last_path_separator(const char *filename);
extern void canonicalize_path(char *path);
extern const char *get_progname(const char *argv0);
extern void get_share_path(const char *my_exec_path, char *ret_path);