From a49f6ad0140a2b4e7915dfb22df3a331d4fcadad Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Fri, 15 Oct 2004 04:32:28 +0000 Subject: Add full path in error report for version mismatch of binaries. --- src/bin/initdb/initdb.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/bin/initdb/initdb.c') diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index da698e55de..e00c2f9c18 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.61 2004/10/12 21:54:42 petere Exp $ + * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.62 2004/10/15 04:31:48 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -2268,18 +2268,24 @@ main(int argc, char *argv[]) if ((ret = find_other_exec(argv[0], "postgres", PG_VERSIONSTR, backend_exec)) < 0) { + char full_path[MAXPGPATH]; + + if (find_my_exec(argv[0], full_path) < 0) + StrNCpy(full_path, progname, MAXPGPATH); + if (ret == -1) fprintf(stderr, _("The program \"postgres\" is needed by %s " - "but was not found in the same directory as \"%s\".\n" + "but was not found in the\n" + "same directory as \"%s\".\n" "Check your installation.\n"), - progname, progname); + progname, full_path); else fprintf(stderr, - _("The program \"postgres\" was found by %s " - "but was not the same version as \"%s\".\n" + _("The program \"postgres\" was found by \"%s\"\n" + "but was not the same version as %s.\n" "Check your installation.\n"), - progname, progname); + full_path, progname); exit(1); } -- cgit v1.2.1