mirror of
https://github.com/postgres/postgres.git
synced 2025-08-25 20:23:07 +03:00
Clean up newlines following left parentheses
We used to strategically place newlines after some function call left parentheses to make pgindent move the argument list a few chars to the left, so that the whole line would fit under 80 chars. However, pgindent no longer does that, so the newlines just made the code vertically longer for no reason. Remove those newlines, and reflow some of those lines for some extra naturality. Reviewed-by: Michael Paquier, Tom Lane Discussion: https://postgr.es/m/20200129200401.GA6303@alvherre.pgsql
This commit is contained in:
@@ -2301,10 +2301,7 @@ PQconnectPoll(PGconn *conn)
|
||||
|
||||
default:
|
||||
appendPQExpBufferStr(&conn->errorMessage,
|
||||
libpq_gettext(
|
||||
"invalid connection state, "
|
||||
"probably indicative of memory corruption\n"
|
||||
));
|
||||
libpq_gettext("invalid connection state, probably indicative of memory corruption\n"));
|
||||
goto error_return;
|
||||
}
|
||||
|
||||
@@ -3217,9 +3214,7 @@ keep_going: /* We will come back to here until there is
|
||||
if (!(beresp == 'R' || beresp == 'E'))
|
||||
{
|
||||
appendPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext(
|
||||
"expected authentication request from "
|
||||
"server, but received %c\n"),
|
||||
libpq_gettext("expected authentication request from server, but received %c\n"),
|
||||
beresp);
|
||||
goto error_return;
|
||||
}
|
||||
@@ -3250,9 +3245,7 @@ keep_going: /* We will come back to here until there is
|
||||
if (beresp == 'R' && (msgLength < 8 || msgLength > 2000))
|
||||
{
|
||||
appendPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext(
|
||||
"expected authentication request from "
|
||||
"server, but received %c\n"),
|
||||
libpq_gettext("expected authentication request from server, but received %c\n"),
|
||||
beresp);
|
||||
goto error_return;
|
||||
}
|
||||
@@ -4637,8 +4630,9 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
|
||||
p = strchr(url + strlen(LDAP_URL), '/');
|
||||
if (p == NULL || *(p + 1) == '\0' || *(p + 1) == '?')
|
||||
{
|
||||
printfPQExpBuffer(errorMessage, libpq_gettext(
|
||||
"invalid LDAP URL \"%s\": missing distinguished name\n"), purl);
|
||||
printfPQExpBuffer(errorMessage,
|
||||
libpq_gettext("invalid LDAP URL \"%s\": missing distinguished name\n"),
|
||||
purl);
|
||||
free(url);
|
||||
return 3;
|
||||
}
|
||||
@@ -4648,8 +4642,9 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
|
||||
/* attribute */
|
||||
if ((p = strchr(dn, '?')) == NULL || *(p + 1) == '\0' || *(p + 1) == '?')
|
||||
{
|
||||
printfPQExpBuffer(errorMessage, libpq_gettext(
|
||||
"invalid LDAP URL \"%s\": must have exactly one attribute\n"), purl);
|
||||
printfPQExpBuffer(errorMessage,
|
||||
libpq_gettext("invalid LDAP URL \"%s\": must have exactly one attribute\n"),
|
||||
purl);
|
||||
free(url);
|
||||
return 3;
|
||||
}
|
||||
@@ -4690,8 +4685,9 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
|
||||
lport = strtol(portstr, &endptr, 10);
|
||||
if (*portstr == '\0' || *endptr != '\0' || errno || lport < 0 || lport > 65535)
|
||||
{
|
||||
printfPQExpBuffer(errorMessage, libpq_gettext(
|
||||
"invalid LDAP URL \"%s\": invalid port number\n"), purl);
|
||||
printfPQExpBuffer(errorMessage,
|
||||
libpq_gettext("invalid LDAP URL \"%s\": invalid port number\n"),
|
||||
purl);
|
||||
free(url);
|
||||
return 3;
|
||||
}
|
||||
@@ -4701,8 +4697,9 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
|
||||
/* Allow only one attribute */
|
||||
if (strchr(attrs[0], ',') != NULL)
|
||||
{
|
||||
printfPQExpBuffer(errorMessage, libpq_gettext(
|
||||
"invalid LDAP URL \"%s\": must have exactly one attribute\n"), purl);
|
||||
printfPQExpBuffer(errorMessage,
|
||||
libpq_gettext("invalid LDAP URL \"%s\": must have exactly one attribute\n"),
|
||||
purl);
|
||||
free(url);
|
||||
return 3;
|
||||
}
|
||||
@@ -4900,8 +4897,8 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
|
||||
}
|
||||
else if (ld_is_nl_cr(*p))
|
||||
{
|
||||
printfPQExpBuffer(errorMessage, libpq_gettext(
|
||||
"missing \"=\" after \"%s\" in connection info string\n"),
|
||||
printfPQExpBuffer(errorMessage,
|
||||
libpq_gettext("missing \"=\" after \"%s\" in connection info string\n"),
|
||||
optname);
|
||||
free(result);
|
||||
return 3;
|
||||
@@ -4919,8 +4916,8 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
|
||||
}
|
||||
else if (!ld_is_sp_tab(*p))
|
||||
{
|
||||
printfPQExpBuffer(errorMessage, libpq_gettext(
|
||||
"missing \"=\" after \"%s\" in connection info string\n"),
|
||||
printfPQExpBuffer(errorMessage,
|
||||
libpq_gettext("missing \"=\" after \"%s\" in connection info string\n"),
|
||||
optname);
|
||||
free(result);
|
||||
return 3;
|
||||
@@ -5008,8 +5005,8 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
|
||||
|
||||
if (state == 5 || state == 6)
|
||||
{
|
||||
printfPQExpBuffer(errorMessage, libpq_gettext(
|
||||
"unterminated quoted string in connection info string\n"));
|
||||
printfPQExpBuffer(errorMessage,
|
||||
libpq_gettext("unterminated quoted string in connection info string\n"));
|
||||
return 3;
|
||||
}
|
||||
|
||||
|
@@ -802,8 +802,7 @@ retry4:
|
||||
*/
|
||||
definitelyEOF:
|
||||
printfPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext(
|
||||
"server closed the connection unexpectedly\n"
|
||||
libpq_gettext("server closed the connection unexpectedly\n"
|
||||
"\tThis probably means the server terminated abnormally\n"
|
||||
"\tbefore or while processing the request.\n"));
|
||||
|
||||
|
@@ -84,10 +84,7 @@ pqSetenvPoll(PGconn *conn)
|
||||
|
||||
default:
|
||||
printfPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext(
|
||||
"invalid setenv state %c, "
|
||||
"probably indicative of memory corruption\n"
|
||||
),
|
||||
libpq_gettext("invalid setenv state %c, probably indicative of memory corruption\n"),
|
||||
conn->setenv_state);
|
||||
goto error_return;
|
||||
}
|
||||
@@ -626,8 +623,7 @@ pqParseInput2(PGconn *conn)
|
||||
*/
|
||||
default:
|
||||
printfPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext(
|
||||
"unexpected response from server; first received character was \"%c\"\n"),
|
||||
libpq_gettext("unexpected response from server; first received character was \"%c\"\n"),
|
||||
id);
|
||||
/* build an error result holding the error message */
|
||||
pqSaveErrorResult(conn);
|
||||
|
@@ -405,8 +405,7 @@ pqParseInput3(PGconn *conn)
|
||||
break;
|
||||
default:
|
||||
printfPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext(
|
||||
"unexpected response from server; first received character was \"%c\"\n"),
|
||||
libpq_gettext("unexpected response from server; first received character was \"%c\"\n"),
|
||||
id);
|
||||
/* build an error result holding the error message */
|
||||
pqSaveErrorResult(conn);
|
||||
@@ -447,8 +446,7 @@ static void
|
||||
handleSyncLoss(PGconn *conn, char id, int msgLength)
|
||||
{
|
||||
printfPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext(
|
||||
"lost synchronization with server: got message type \"%c\", length %d\n"),
|
||||
libpq_gettext("lost synchronization with server: got message type \"%c\", length %d\n"),
|
||||
id, msgLength);
|
||||
/* build an error result holding the error message */
|
||||
pqSaveErrorResult(conn);
|
||||
|
@@ -206,8 +206,7 @@ rloop:
|
||||
if (result_errno == EPIPE ||
|
||||
result_errno == ECONNRESET)
|
||||
printfPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext(
|
||||
"server closed the connection unexpectedly\n"
|
||||
libpq_gettext("server closed the connection unexpectedly\n"
|
||||
"\tThis probably means the server terminated abnormally\n"
|
||||
"\tbefore or while processing the request.\n"));
|
||||
else
|
||||
@@ -314,8 +313,7 @@ pgtls_write(PGconn *conn, const void *ptr, size_t len)
|
||||
result_errno = SOCK_ERRNO;
|
||||
if (result_errno == EPIPE || result_errno == ECONNRESET)
|
||||
printfPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext(
|
||||
"server closed the connection unexpectedly\n"
|
||||
libpq_gettext("server closed the connection unexpectedly\n"
|
||||
"\tThis probably means the server terminated abnormally\n"
|
||||
"\tbefore or while processing the request.\n"));
|
||||
else
|
||||
@@ -578,10 +576,8 @@ pgtls_verify_peer_name_matches_certificate_guts(PGconn *conn,
|
||||
if (cn_index >= 0)
|
||||
{
|
||||
(*names_examined)++;
|
||||
rc = openssl_verify_peer_name_matches_certificate_name(
|
||||
conn,
|
||||
X509_NAME_ENTRY_get_data(
|
||||
X509_NAME_get_entry(subject_name, cn_index)),
|
||||
rc = openssl_verify_peer_name_matches_certificate_name(conn,
|
||||
X509_NAME_ENTRY_get_data(X509_NAME_get_entry(subject_name, cn_index)),
|
||||
first_name);
|
||||
}
|
||||
}
|
||||
|
@@ -264,8 +264,7 @@ pqsecure_raw_read(PGconn *conn, void *ptr, size_t len)
|
||||
#ifdef ECONNRESET
|
||||
case ECONNRESET:
|
||||
printfPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext(
|
||||
"server closed the connection unexpectedly\n"
|
||||
libpq_gettext("server closed the connection unexpectedly\n"
|
||||
"\tThis probably means the server terminated abnormally\n"
|
||||
"\tbefore or while processing the request.\n"));
|
||||
break;
|
||||
@@ -381,8 +380,7 @@ retry_masked:
|
||||
case ECONNRESET:
|
||||
#endif
|
||||
printfPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext(
|
||||
"server closed the connection unexpectedly\n"
|
||||
libpq_gettext("server closed the connection unexpectedly\n"
|
||||
"\tThis probably means the server terminated abnormally\n"
|
||||
"\tbefore or while processing the request.\n"));
|
||||
break;
|
||||
|
@@ -291,8 +291,7 @@ winsock_strerror(int err, char *strerrbuf, size_t buflen)
|
||||
if (!dlls[i].loaded)
|
||||
{
|
||||
dlls[i].loaded = 1; /* Only load once */
|
||||
dlls[i].handle = (void *) LoadLibraryEx(
|
||||
dlls[i].dll_name,
|
||||
dlls[i].handle = (void *) LoadLibraryEx(dlls[i].dll_name,
|
||||
0,
|
||||
LOAD_LIBRARY_AS_DATAFILE);
|
||||
}
|
||||
@@ -304,13 +303,11 @@ winsock_strerror(int err, char *strerrbuf, size_t buflen)
|
||||
| FORMAT_MESSAGE_IGNORE_INSERTS
|
||||
| (dlls[i].handle ? FORMAT_MESSAGE_FROM_HMODULE : 0);
|
||||
|
||||
success = 0 != FormatMessage(
|
||||
flags,
|
||||
success = 0 != FormatMessage(flags,
|
||||
dlls[i].handle, err,
|
||||
MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT),
|
||||
strerrbuf, buflen - 64,
|
||||
0
|
||||
);
|
||||
0);
|
||||
}
|
||||
|
||||
if (!success)
|
||||
|
Reference in New Issue
Block a user