1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Fix core dumps, inability to count, etc associated with canonicalize_path

patches.
This commit is contained in:
Tom Lane
2004-08-13 14:47:23 +00:00
parent d785841f83
commit 79f9ee9d15
4 changed files with 13 additions and 10 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/port/path.c,v 1.29 2004/08/12 19:03:44 momjian Exp $
* $PostgreSQL: pgsql/src/port/path.c,v 1.30 2004/08/13 14:47:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -335,7 +335,7 @@ set_pglocale_pgservice(const char *argv0, const char *app)
{
char path[MAXPGPATH];
char my_exec_path[MAXPGPATH];
char env_path[MAXPGPATH + sizeof("PGLOCALEDIR=")]; /* longer than PGSYSCONFDIR */
char env_path[MAXPGPATH + sizeof("PGSYSCONFDIR=")]; /* longer than PGLOCALEDIR */
/* don't set LC_ALL in the backend */
if (strcmp(app, "postgres") != 0)
@ -353,7 +353,7 @@ set_pglocale_pgservice(const char *argv0, const char *app)
{
/* set for libpq to use */
snprintf(env_path, sizeof(env_path), "PGLOCALEDIR=%s", path);
canonicalize_path(env_path);
canonicalize_path(env_path + 12);
putenv(strdup(env_path));
}
#endif
@ -364,7 +364,7 @@ set_pglocale_pgservice(const char *argv0, const char *app)
/* set for libpq to use */
snprintf(env_path, sizeof(env_path), "PGSYSCONFDIR=%s", path);
canonicalize_path(env_path);
canonicalize_path(env_path + 13);
putenv(strdup(env_path));
}
}