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

Commitff2fbac

Browse files
committed
Fix trim_trailing_separator() to not trim c:\ nor \\network\ on Win32.
1 parenteee9317 commitff2fbac

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

‎src/port/path.c

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/port/path.c,v 1.21 2004/07/10 22:58:42tgl Exp $
11+
* $PostgreSQL: pgsql/src/port/path.c,v 1.22 2004/07/11 02:59:42momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -389,7 +389,26 @@ static void
389389
trim_trailing_separator(char*path)
390390
{
391391
char*p=path+strlen(path);
392-
392+
393+
#ifdefWIN32
394+
/* Skip over network and drive specifiers for win32 */
395+
if (strlen(path) >=2)
396+
{
397+
if (IS_DIR_SEP(path[0])&&IS_DIR_SEP(path[1]))
398+
{
399+
path+=2;
400+
while (*path&& !IS_DIR_SEP(*path))
401+
path++;
402+
}
403+
elseif (isalpha(path[0])&&path[1]==':')
404+
{
405+
path++;
406+
if (IS_DIR_SEP(path[1]))
407+
path++;
408+
}
409+
}
410+
#endif
411+
393412
/* trim off trailing slashes */
394413
if (p>path)
395414
for (p--;p>path&&IS_DIR_SEP(*p);p--)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp