diff options
author | Bruce Momjian <bruce@momjian.us> | 2011-07-30 01:50:18 -0400 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2011-07-30 01:50:55 -0400 |
commit | a31dc392d684627d0943fe67491bea91c5e619aa (patch) | |
tree | 369a35a54ce526c0fc87dfb11b589c539645c533 | |
parent | b4fbe392f8ff6ff1a66b488eb7197eef9e1770a4 (diff) | |
download | postgresql-a31dc392d684627d0943fe67491bea91c5e619aa.tar.gz postgresql-a31dc392d684627d0943fe67491bea91c5e619aa.zip |
Fix pg_update to properly test for the data directory's existence on
Win32.
Backpatch to 9.1.
-rw-r--r-- | contrib/pg_upgrade/exec.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/pg_upgrade/exec.c b/contrib/pg_upgrade/exec.c index 3493696f92f..2f5e76da2dc 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) |