From 4d2d5b8196c774a1ac23cd7e7567e8bbd589b6aa Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sat, 30 Jul 2011 01:50:19 -0400 Subject: [PATCH] Fix pg_update to properly test for the data directory's existence on Win32. Backpatch to 9.1. --- contrib/pg_upgrade/exec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 2.40.0