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

Commit5d7f699

Browse files
committed
Use (unsigned char) cast in argument of pg_tolower(). Maybe it works on
Windows without that, but we shouldn't put bad examples where people mightcopy them. Also, reformat slightly to improve the odds that pgindentwon't go nuts on this.
1 parent1b2bb33 commit5d7f699

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

‎src/port/path.c

Lines changed: 7 additions & 5 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.77 2009/04/0311:52:08 mha Exp $
11+
* $PostgreSQL: pgsql/src/port/path.c,v 1.78 2009/04/0323:27:17 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -420,20 +420,22 @@ get_progname(const char *argv0)
420420

421421

422422
/*
423-
* dir_strcmp: strcmp except any two DIR_SEP characters are considered equal
423+
* dir_strcmp: strcmp except any two DIR_SEP characters are considered equal,
424+
* and we honor filesystem case insensitivity if known
424425
*/
425426
staticint
426427
dir_strcmp(constchar*s1,constchar*s2)
427428
{
428429
while (*s1&&*s2)
429430
{
431+
if (
430432
#ifndefWIN32
431-
if (*s1!=*s2&&
433+
*s1!=*s2
432434
#else
433435
/* On windows, paths are case-insensitive */
434-
if (pg_tolower(*s1)!=pg_tolower(*s2)&&
436+
pg_tolower((unsignedchar)*s1)!=pg_tolower((unsignedchar)*s2)
435437
#endif
436-
!(IS_DIR_SEP(*s1)&&IS_DIR_SEP(*s2)))
438+
&&!(IS_DIR_SEP(*s1)&&IS_DIR_SEP(*s2)))
437439
return (int)*s1- (int)*s2;
438440
s1++,s2++;
439441
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp