Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita0fc05a

Browse files
committed
Go back to emitting path names with forward slashes on Windows.
I'm not clear on what the double-backslash idea was intended to fix,but it breaks at least mingw GNU Make. Per report from Thomas Hallgren.
1 parent84cc9a4 commita0fc05a

File tree

1 file changed

+10
-29
lines changed

1 file changed

+10
-29
lines changed

‎src/bin/pg_config/pg_config.c

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
1919
*
20-
* $PostgreSQL: pgsql/src/bin/pg_config/pg_config.c,v 1.15 2005/10/06 12:04:58 petere Exp $
20+
* $PostgreSQL: pgsql/src/bin/pg_config/pg_config.c,v 1.16 2005/10/13 17:58:44 tgl Exp $
2121
*
2222
*-------------------------------------------------------------------------
2323
*/
@@ -32,9 +32,9 @@ static charmypath[MAXPGPATH];
3232

3333
/*
3434
* This function cleans up the paths for use with either cmd.exe or Msys
35-
* on Windows. We need them to usedouble backslashes and filenames without
36-
*spaces (for which ashort filename is the safest equivalent) eg:
37-
* C:\\Progra~1\\
35+
* on Windows. We need them to usefilenames without spaces, for which a
36+
* short filename is the safest equivalent, eg:
37+
*C:/Progra~1/
3838
*
3939
* This can fail in 2 ways - if the path doesn't exist, or short names are
4040
* disabled. In the first case, don't return any path. In the second case,
@@ -45,8 +45,7 @@ static void
4545
cleanup_path(char*path)
4646
{
4747
#ifdefWIN32
48-
intx=0,y=0;
49-
chartemp[MAXPGPATH];
48+
char*ptr;
5049

5150
if (GetShortPathName(path,path,MAXPGPATH-1)==0)
5251
{
@@ -59,31 +58,13 @@ cleanup_path(char *path)
5958
return;
6059
}
6160
}
62-
6361

64-
/* Replace '\' with '\\'. */
65-
for (x=0;x<strlen(path);x++)
66-
{
67-
if (path[x]=='/'||path[x]=='\\')
68-
{
69-
temp[y]='\\';
70-
y++;
71-
temp[y]='\\';
72-
}
73-
else
74-
{
75-
temp[y]=path[x];
76-
}
77-
78-
y++;
79-
80-
/* Bail out if we're too close to MAXPGPATH */
81-
if (y >=MAXPGPATH-2)
82-
break;
62+
/* Replace '\' with '/' */
63+
for (ptr=path;*ptr;ptr++)
64+
{
65+
if (*ptr=='\\')
66+
*ptr='/';
8367
}
84-
temp[y]='\0';
85-
86-
strncpy(path,temp,MAXPGPATH-1);
8768
#endif
8869
}
8970

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp