|
39 | 39 | * Portions Copyright (c) 1994, Regents of the University of California
|
40 | 40 | * Portions taken from FreeBSD.
|
41 | 41 | *
|
42 |
| - * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.61 2004/10/12 21:54:42 petere Exp $ |
| 42 | + * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.62 2004/10/15 04:31:48 momjian Exp $ |
43 | 43 | *
|
44 | 44 | *-------------------------------------------------------------------------
|
45 | 45 | */
|
@@ -2268,18 +2268,24 @@ main(int argc, char *argv[])
|
2268 | 2268 | if ((ret = find_other_exec(argv[0], "postgres", PG_VERSIONSTR,
|
2269 | 2269 | backend_exec)) < 0)
|
2270 | 2270 | {
|
| 2271 | + char full_path[MAXPGPATH]; |
| 2272 | + |
| 2273 | + if (find_my_exec(argv[0], full_path) < 0) |
| 2274 | + StrNCpy(full_path, progname, MAXPGPATH); |
| 2275 | + |
2271 | 2276 | if (ret == -1)
|
2272 | 2277 | fprintf(stderr,
|
2273 | 2278 | _("The program \"postgres\" is needed by %s "
|
2274 |
| - "but was not found in the same directory as \"%s\".\n" |
| 2279 | + "but was not found in the\n" |
| 2280 | + "same directory as \"%s\".\n" |
2275 | 2281 | "Check your installation.\n"),
|
2276 |
| - progname, progname); |
| 2282 | + progname, full_path); |
2277 | 2283 | else
|
2278 | 2284 | fprintf(stderr,
|
2279 |
| - _("The program \"postgres\" was found by %s " |
2280 |
| - "but was not the same version as \"%s\".\n" |
| 2285 | + _("The program \"postgres\" was found by \"%s\"\n" |
| 2286 | + "but was not the same version as %s.\n" |
2281 | 2287 | "Check your installation.\n"),
|
2282 |
| - progname, progname); |
| 2288 | + full_path, progname); |
2283 | 2289 | exit(1);
|
2284 | 2290 | }
|
2285 | 2291 |
|
|
0 commit comments