diff options
Diffstat (limited to 'src/port/path.c')
-rw-r--r-- | src/port/path.c | 56 |
1 files changed, 34 insertions, 22 deletions
diff --git a/src/port/path.c b/src/port/path.c index dae4eeab099..8017417b708 100644 --- a/src/port/path.c +++ b/src/port/path.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/port/path.c,v 1.33 2004/08/29 05:07:02 momjian Exp $ + * $PostgreSQL: pgsql/src/port/path.c,v 1.34 2004/08/29 21:08:48 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -324,6 +324,39 @@ get_locale_path(const char *my_exec_path, char *ret_path) } +/* + * get_home_path + */ +bool +get_home_path(char *ret_path) +{ + if (getenv(HOMEDIR) == NULL) + { + *ret_path = '\0'; + return false; + } + else + { + StrNCpy(ret_path, getenv(HOMEDIR), MAXPGPATH); + canonicalize_path(ret_path); + return true; + } +} + + +/* + * get_parent_directory + * + * Modify the given string in-place to name the parent directory of the + * named file. + */ +void +get_parent_directory(char *path) +{ + trim_directory(path); + trim_trailing_separator(path); +} + /* * set_pglocale_pgservice @@ -374,27 +407,6 @@ set_pglocale_pgservice(const char *argv0, const char *app) /* - * get_include_path - */ -bool -get_home_path(char *ret_path) -{ - if (getenv(HOMEDIR) == NULL) - { - *ret_path = '\0'; - return false; - } - else - { - StrNCpy(ret_path, getenv(HOMEDIR), MAXPGPATH); - canonicalize_path(ret_path); - return true; - } -} - - - -/* * make_relative - adjust path to be relative to bin/ */ static void |