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

Commitd2286a9

Browse files
committed
Allow embedded spaces without quoting in unix_socket_directories entries.
This fix removes an unnecessary incompatibility with the old behavior ofthe unix_socket_directory parameter. Since pathnames with embedded spacesare fairly popular on some platforms, the incompatibility could besignificant in practice. We'll still strip unquoted leading/trailingspaces, however.No docs update since the documentation already implied that it workedlike this.Per bug #7514 from Murray Cumming.
1 parent25f4fe4 commitd2286a9

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

‎src/backend/utils/adt/varlena.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,9 +2451,9 @@ SplitIdentifierString(char *rawstring, char separator,
24512451
*
24522452
* This is similar to SplitIdentifierString, except that the parsing
24532453
* rules are meant to handle pathnames instead of identifiers: there is
2454-
* no downcasing, the max length is MAXPGPATH-1, and we apply
2455-
* canonicalize_path() to each extracted string. Because of the last,
2456-
* the returned strings are separately palloc'd rather than being
2454+
* no downcasing,embedded spaces are allowed,the max length is MAXPGPATH-1,
2455+
*and we applycanonicalize_path() to each extracted string. Because of the
2456+
*last,the returned strings are separately palloc'd rather than being
24572457
* pointers into rawstring --- but we still scribble on rawstring.
24582458
*
24592459
* Inputs:
@@ -2510,13 +2510,16 @@ SplitDirectoriesString(char *rawstring, char separator,
25102510
}
25112511
else
25122512
{
2513-
/* Unquoted name --- extends to separator or whitespace */
2514-
curname=nextp;
2515-
while (*nextp&&*nextp!=separator&&
2516-
!isspace((unsignedchar)*nextp))
2513+
/* Unquoted name --- extends to separator or end of string */
2514+
curname=endp=nextp;
2515+
while (*nextp&&*nextp!=separator)
2516+
{
2517+
/* trailing whitespace should not be included in name */
2518+
if (!isspace((unsignedchar)*nextp))
2519+
endp=nextp+1;
25172520
nextp++;
2518-
endp=nextp;
2519-
if (curname==nextp)
2521+
}
2522+
if (curname==endp)
25202523
return false;/* empty unquoted name not allowed */
25212524
}
25222525

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp