mirror of
https://github.com/postgres/postgres.git
synced 2025-05-08 07:21:33 +03:00
ecpg: avoid adding whitespace around '&' in connection URLs.
The preprocessor really should not have done this to begin with. The space after '&' was masked by ECPGconnect's skipping spaces before option keywords, and the space before by dint of libpq being (mostly) insensitive to trailing space in option values. We fixed the one known problem with that in 920d51979. Hence this patch is mostly cosmetic, and we'll just change it in HEAD. Discussion: https://postgr.es/m/TY2PR01MB36286A7B97B9A15793335D18C1772@TY2PR01MB3628.jpnprd01.prod.outlook.com
This commit is contained in:
parent
ddbba3aac8
commit
f22e84df1d
@ -579,7 +579,10 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
|
||||
* The options string contains "keyword=value" pairs separated by
|
||||
* '&'s. We must break this up into keywords and values to pass to
|
||||
* libpq (it's okay to scribble on the options string). We ignore
|
||||
* spaces just before each keyword or value.
|
||||
* spaces just before each keyword or value. (The preprocessor used
|
||||
* to add spaces around '&'s, making it necessary to ignore spaces
|
||||
* before keywords here. While it no longer does that, we still must
|
||||
* skip spaces to support code compiled with older preprocessors.)
|
||||
*/
|
||||
for (str = options; *str;)
|
||||
{
|
||||
|
@ -348,7 +348,7 @@ connect_options: ColId opt_opt_value
|
||||
if (strcmp($3, "&") != 0)
|
||||
mmerror(PARSE_ERROR, ET_ERROR, "unrecognized token \"%s\"", $3);
|
||||
|
||||
$$ = cat_str(3, make2_str($1, $2), $3, $4);
|
||||
$$ = make3_str(make2_str($1, $2), $3, $4);
|
||||
}
|
||||
;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user