1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-14 18:42:34 +03:00

Pre-beta mechanical code beautification.

Run pgindent, pgperltidy, and reformat-dat-files.
I manually fixed a couple of comments that pgindent uglified.
This commit is contained in:
Tom Lane
2022-05-12 15:17:30 -04:00
parent 93909599cd
commit 23e7b38bfe
287 changed files with 5193 additions and 3549 deletions

View File

@ -37,13 +37,13 @@ typedef struct bbsink_shell
FILE *pipe;
} bbsink_shell;
void _PG_init(void);
void _PG_init(void);
static void *shell_check_detail(char *target, char *target_detail);
static bbsink *shell_get_sink(bbsink *next_sink, void *detail_arg);
static void bbsink_shell_begin_archive(bbsink *sink,
const char *archive_name);
const char *archive_name);
static void bbsink_shell_archive_contents(bbsink *sink, size_t len);
static void bbsink_shell_end_archive(bbsink *sink);
static void bbsink_shell_begin_manifest(bbsink *sink);
@ -101,7 +101,7 @@ shell_check_detail(char *target, char *target_detail)
{
if (shell_required_role[0] != '\0')
{
Oid roleid;
Oid roleid;
StartTransactionCommand();
roleid = get_role_oid(shell_required_role, true);
@ -125,8 +125,8 @@ static bbsink *
shell_get_sink(bbsink *next_sink, void *detail_arg)
{
bbsink_shell *sink;
bool has_detail_escape = false;
char *c;
bool has_detail_escape = false;
char *c;
/*
* Set up the bbsink.
@ -171,15 +171,15 @@ shell_get_sink(bbsink *next_sink, void *detail_arg)
/*
* Since we're passing the string provided by the user to popen(), it will
* be interpreted by the shell, which is a potential security
* vulnerability, since the user invoking this module is not necessarily
* a superuser. To stay out of trouble, we must disallow any shell
* vulnerability, since the user invoking this module is not necessarily a
* superuser. To stay out of trouble, we must disallow any shell
* metacharacters here; to be conservative and keep things simple, we
* allow only alphanumerics.
*/
if (sink->target_detail != NULL)
{
char *d;
bool scary = false;
char *d;
bool scary = false;
for (d = sink->target_detail; *d != '\0'; ++d)
{
@ -210,7 +210,7 @@ static char *
shell_construct_command(char *base_command, const char *filename,
char *target_detail)
{
StringInfoData buf;
StringInfoData buf;
char *c;
initStringInfo(&buf);
@ -271,7 +271,7 @@ shell_construct_command(char *base_command, const char *filename,
static void
shell_finish_command(bbsink_shell *sink)
{
int pclose_rc;
int pclose_rc;
/* There should be a command running. */
Assert(sink->current_command != NULL);
@ -335,9 +335,8 @@ shell_send_data(bbsink_shell *sink, size_t len)
{
/*
* The error we're about to throw would shut down the command
* anyway, but we may get a more meaningful error message by
* doing this. If not, we'll fall through to the generic error
* below.
* anyway, but we may get a more meaningful error message by doing
* this. If not, we'll fall through to the generic error below.
*/
shell_finish_command(sink);
errno = EPIPE;