17
17
*
18
18
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
19
19
*
20
- * $PostgreSQL: pgsql/src/bin/pg_config/pg_config.c,v 1.18 2006/03/05 15:58:50 momjian Exp $
20
+ * $PostgreSQL: pgsql/src/bin/pg_config/pg_config.c,v 1.19 2006/06/06 22:32:19 momjian Exp $
21
21
*
22
22
*-------------------------------------------------------------------------
23
23
*/
@@ -35,30 +35,19 @@ static char mypath[MAXPGPATH];
35
35
* on Windows. We need them to use filenames without spaces, for which a
36
36
* short filename is the safest equivalent, eg:
37
37
* C:/Progra~1/
38
- *
39
- * This can fail in 2 ways - if the path doesn't exist, or short names are
40
- * disabled. In the first case, don't return any path. In the second case,
41
- * we leave the path in the long form. In this case, it does still seem to
42
- * fix elements containing spaces which is all we actually need.
43
38
*/
44
39
static void
45
40
cleanup_path (char * path )
46
41
{
47
42
#ifdef WIN32
48
43
char * ptr ;
49
44
50
- if (GetShortPathName (path , path , MAXPGPATH - 1 ) == 0 )
51
- {
52
- /*
53
- * Ignore ERROR_INVALID_PARAMETER as it almost certainly means that
54
- * short names are disabled
55
- */
56
- if (GetLastError () != ERROR_INVALID_PARAMETER )
57
- {
58
- path [0 ] = '\0' ;
59
- return ;
60
- }
61
- }
45
+ /*
46
+ * GetShortPathName() will fail if the path does not exist, or short names
47
+ * are disabled on this file system. In both cases, we just return the
48
+ * original path.
49
+ */
50
+ GetShortPathName (path , path , MAXPGPATH - 1 );
62
51
63
52
/* Replace '\' with '/' */
64
53
for (ptr = path ; * ptr ; ptr ++ )
0 commit comments