summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-08-09 20:20:47 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-08-09 20:20:47 +0000
commitb06c90764526ccf291011ecbbcab49ae9729f65a (patch)
treefa8c61fb9f807e58fb098b9d565a698f0fde9fde /src/bin
parent35f539b481b5524bd331cb7b75df848da51b43e5 (diff)
downloadpostgresql-b06c90764526ccf291011ecbbcab49ae9729f65a.tar.gz
Path-mangling logic was failing to account for paths containing mentions
of '.' or '..'. Extend canonicalize_path() to trim off trailing occurrences of these things, and use it to fix up paths where needed (which I think is only after places where we trim the last path component, but maybe some others will turn up). Fixes Josh's complaint that './initdb' does not work.
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/initdb/initdb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 55b782004c..de059e65bc 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -39,7 +39,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions taken from FreeBSD.
*
- * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.46 2004/08/01 06:19:23 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.47 2004/08/09 20:20:47 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2227,6 +2227,7 @@ main(int argc, char *argv[])
/* store binary directory */
strcpy(bin_path, backend_exec);
*last_dir_separator(bin_path) = '\0';
+ canonicalize_path(bin_path);
if (!share_path)
{