From: Bruce Momjian Date: Sat, 30 Jul 2011 05:50:18 +0000 (-0400) Subject: Fix pg_update to properly test for the data directory's existence on X-Git-Tag: REL9_2_BETA1~1341 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a31dc392d684627d0943fe67491bea91c5e619aa;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 3493696f92..2f5e76da2d 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)