1717 *
1818 * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
1919 *
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 $
2121 *
2222 *-------------------------------------------------------------------------
2323 */
@@ -35,30 +35,19 @@ static char mypath[MAXPGPATH];
3535 * on Windows. We need them to use filenames without spaces, for which a
3636 * short filename is the safest equivalent, eg:
3737 *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.
4338 */
4439static void
4540cleanup_path (char * path )
4641{
4742#ifdef WIN32
4843char * ptr ;
4944
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 );
6251
6352/* Replace '\' with '/' */
6453for (ptr = path ;* ptr ;ptr ++ )