aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2006-06-06 22:32:19 +0000
committerBruce Momjian <bruce@momjian.us>2006-06-06 22:32:19 +0000
commit62e7ad66033f8c0123f419323371b22d14c4402c (patch)
tree693d987cfd8f4e6940a2d4a9191abfd97e4b3c71 /src
parent8a30cc212745681e5328c030f8fc5d210d733b92 (diff)
downloadpostgresql-62e7ad66033f8c0123f419323371b22d14c4402c.tar.gz
postgresql-62e7ad66033f8c0123f419323371b22d14c4402c.zip
On Win32, return original patch if GetShortPathName() fails (no short
name, path does not exist), rather than returning nothing. Backpatch to 8.1.X.
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_config/pg_config.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/src/bin/pg_config/pg_config.c b/src/bin/pg_config/pg_config.c
index e654036a611..cf32be1f2bd 100644
--- a/src/bin/pg_config/pg_config.c
+++ b/src/bin/pg_config/pg_config.c
@@ -17,7 +17,7 @@
*
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/pg_config/pg_config.c,v 1.18 2006/03/05 15:58:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_config/pg_config.c,v 1.19 2006/06/06 22:32:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -35,11 +35,6 @@ static char mypath[MAXPGPATH];
* on Windows. We need them to use filenames without spaces, for which a
* short filename is the safest equivalent, eg:
* C:/Progra~1/
- *
- * This can fail in 2 ways - if the path doesn't exist, or short names are
- * disabled. In the first case, don't return any path. In the second case,
- * we leave the path in the long form. In this case, it does still seem to
- * fix elements containing spaces which is all we actually need.
*/
static void
cleanup_path(char *path)
@@ -47,18 +42,12 @@ cleanup_path(char *path)
#ifdef WIN32
char *ptr;
- if (GetShortPathName(path, path, MAXPGPATH - 1) == 0)
- {
- /*
- * Ignore ERROR_INVALID_PARAMETER as it almost certainly means that
- * short names are disabled
- */
- if (GetLastError() != ERROR_INVALID_PARAMETER)
- {
- path[0] = '\0';
- return;
- }
- }
+ /*
+ * GetShortPathName() will fail if the path does not exist, or short names
+ * are disabled on this file system. In both cases, we just return the
+ * original path.
+ */
+ GetShortPathName(path, path, MAXPGPATH - 1);
/* Replace '\' with '/' */
for (ptr = path; *ptr; ptr++)