From: Bruce Momjian Date: Sat, 30 Jul 2011 05:50:19 +0000 (-0400) Subject: Fix pg_update to properly test for the data directory's existence on X-Git-Tag: REL9_1_RC1~48 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4d2d5b8196c774a1ac23cd7e7567e8bbd589b6aa;p=postgresql Fix pg_update to properly test for the data directory's existence on Win32. Backpatch to 9.1. --- diff --git a/contrib/pg_upgrade/exec.c b/contrib/pg_upgrade/exec.c index ef21899463..b632584d5c 100644 --- a/contrib/pg_upgrade/exec.c +++ b/contrib/pg_upgrade/exec.c @@ -168,7 +168,9 @@ check_data_dir(const char *pg_data) { struct stat statBuf; - snprintf(subDirName, sizeof(subDirName), "%s/%s", pg_data, + snprintf(subDirName, sizeof(subDirName), "%s%s%s", pg_data, + /* Win32 can't stat() a directory with a trailing slash. */ + *requiredSubdirs[subdirnum] ? "/" : "", requiredSubdirs[subdirnum]); if (stat(subDirName, &statBuf) != 0)